CN110110040A - Language exchange method, device, computer equipment and storage medium - Google Patents

Language exchange method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN110110040A
CN110110040A CN201910198999.8A CN201910198999A CN110110040A CN 110110040 A CN110110040 A CN 110110040A CN 201910198999 A CN201910198999 A CN 201910198999A CN 110110040 A CN110110040 A CN 110110040A
Authority
CN
China
Prior art keywords
interaction
language
information
interaction request
return information
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
CN201910198999.8A
Other languages
Chinese (zh)
Inventor
刘丽珍
吕小立
刘芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Smart 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 OneConnect Smart Technology Co Ltd filed Critical OneConnect Smart Technology Co Ltd
Priority to CN201910198999.8A priority Critical patent/CN110110040A/en
Publication of CN110110040A publication Critical patent/CN110110040A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a kind of language exchange method, device, computer equipment and storage mediums, comprising: obtains the interaction request that target terminal is sent, wherein includes the text information of carrying user's interaction wish in the interaction request;The text information is subjected to word segmentation processing and generates participle collection, and participle collection is converted into term vector matrix;By the term vector Input matrix into preset language interaction models;The first return information of the interaction request is obtained according to the classification results that the language interaction models export.Due to, neural network model is of overall importance for the extraction of term vector matrix character, simultaneously, and the extraction experience obtained by training study several times, therefore, neural network model accurately can understand and classify to the interaction wish of user expressed by text information, it is high make classification results accuracy, and then improve the accuracy rate of return information.

Description

Language exchange method, device, computer equipment and storage medium
Technical field
The present embodiments relate to intelligent interaction field, especially a kind of language exchange method, device, computer equipment and Storage medium.
Background technique
Interactive voice, which refers to user, to be sent instruction to terminal by way of voice or proposes problem, and terminal is according to obtaining The user speech information taken executes the instruction of user or replys the problem of user proposes.Interactive voice enables terminal device to lead to The mode and user for crossing voice interact, user-friendly, while also improving interactive interest.
In the prior art, the important research direction that understanding is interactive voice is carried out to the language message of user.It is common Technical solution are as follows: the voice messaging that will acquire is converted to text information, extracts the keyword in the text information, and by should Keyword searches the operational order or return information for having mapping relations with the keyword in preset mapping database, so Afterwards, it executes the operational order or sends this to user terminal and reply message.
The inventor of the invention has found under study for action, is looked into the prior art by keyword extraction and keyword mapping The method for realizing interactive voice is looked for, due to, single keyword can not accurately express the whole meaning of sentence in sentence, because This, causes the understanding for user language information deviation or mistake occur, and then leads to interactive voice the language fails to express the meaning that mistake is returned Multiple rate is higher.
Summary of the invention
The embodiment of the present invention, which provides, a kind of to be carried out quick and precisely the interaction request of user by using neural network model Language exchange method, device, computer equipment and the storage medium of reply.
In order to solve the above technical problems, the technical solution that the embodiment of the invention uses is: providing a kind of language Say exchange method, comprising:
Obtain the interaction request that target terminal is sent, wherein include carrying user's interaction wish in the interaction request Text information;
The text information is subjected to word segmentation processing and generates participle collection, and participle collection is converted into term vector matrix;
By the term vector Input matrix into preset language interaction models, wherein the language interaction models are pre- First train the neural network model for being used to classify to natural language to convergence state;
The first return information of the interaction request is obtained according to the classification results that the language interaction models export, In, the classification results are series belonging to the text information, and the series is mapped with described first and replys letter Breath.
Optionally, the classification results according to language interaction models output obtain first time of the interaction request After complex information, comprising:
Being searched in preset interactive map list using the text information as qualifications has with the text information Second return information of mapping relations, wherein second return information is that the standard of the text information is replied;
It compares first return information and whether second return information is consistent;
When first return information and second return information are inconsistent, Xiang Suoshu target terminal sends described the Two return informations.
Optionally, the interaction request for obtaining target terminal transmission includes:
Call the interaction channel pre-established, wherein the interaction channel is that the set established with target terminal is connect;
The interaction request that the target terminal uploads is obtained according to the interaction channel.
It optionally, include the location information of the target terminal in the interaction request;It is described by the text information into Row word segmentation processing generates participle collection, and the participle is collected before being converted to term vector matrix, comprising:
Obtain the location information of the target terminal;
The interaction request is distributed to the location information according to the positional information and is saved with jurisdictional processing Point, wherein the processing node is the regional processing center of distributed server system;
The interaction request is sent to the processing node, so that the processing node rings the interaction request It answers.
Optionally, described that the interaction request is sent to the processing node, so that the processing node is to the friendship Mutually request, which respond, includes:
Obtain the object transmission path for going to the processing node, wherein the object transmission path is to go to the place Manage the shortest transmission path of time on node;
The interaction request is sent to the processing node according to the object transmission path, so that the processing node The interaction request is responded.
Optionally, the classification results according to language interaction models output obtain first time of the interaction request After complex information, comprising:
Obtain the connection duration of the interaction channel;
The connection duration is compared with preset first time threshold;
When the connection duration is less than the first time threshold, reselecting with the series there is mapping to close First return information of system.
Optionally, the classification results according to language interaction models output obtain first time of the interaction request Complex information includes:
Obtain the series of the text information of the language interaction models output;
The first return information that there are mapping relations with the series is searched in preset reply database.
In order to solve the above technical problems, the present invention also provides a kind of language interactive devices, comprising:
Module is obtained, for obtaining the interaction request of target terminal transmission, wherein include that carrying is used in the interaction request The text information of family interaction wish;
Processing module generates participle collection for the text information to be carried out word segmentation processing, and the participle is collected and is converted For term vector matrix;
Categorization module is used for the term vector Input matrix into preset language interaction models, wherein the language Interaction models are that training is used for the neural network model classified to natural language to convergence state in advance;
Execution module, the classification results for being exported according to the language interaction models obtain the first of the interaction request Return information, wherein the classification results are series belonging to the text information, and the series is mapped with described First return information.
Optionally, the language interactive device further include:
First processing submodule, for being searched in preset interactive map list using the text information as qualifications There is the second return information of mapping relations with the text information, wherein second return information is the text information Standard reply;
Whether first compares submodule, consistent for comparing first return information and second return information;
First implementation sub-module is used for when first return information and second return information are inconsistent, to institute It states target terminal and sends second return information.
Optionally, the language interactive device further include:
Second processing submodule, for calling the interaction channel pre-established, wherein the interaction channel is and target is whole The set connection that end is established;
Second implementation sub-module, for obtaining the interaction request that the target terminal uploads according to the interaction channel.
It optionally, include the location information of the target terminal in the interaction request, the language interactive device also wraps It includes:
First acquisition submodule, for obtaining the location information of the target terminal;
Third handles submodule, for according to the positional information distributing the interaction request to the location information With jurisdictional processing node, wherein the processing node is the regional processing center of distributed server system;
Third implementation sub-module, for the interaction request to be sent to the processing node, so that the processing node The interaction request is responded.
Optionally, the language interactive device further include:
Second acquisition submodule, for obtaining the object transmission path for going to the processing node, wherein the target passes Defeated path is to go to the shortest transmission path of the processing time on node;
4th implementation sub-module is saved for the interaction request to be sent to the processing according to the object transmission path Point, so that the processing node responds the interaction request.
Optionally, the language interactive device further include:
Third acquisition submodule, for obtaining the connection duration of the interaction channel;
Second compares submodule, for the connection duration to be compared with preset first time threshold;
5th implementation sub-module, for when the connection duration is less than the first time threshold, reselecting and institute State first return information that series has mapping relations.
Optionally, the language interactive device further include:
4th acquisition submodule, the series of the text information for obtaining the language interaction models output;
Fourth process submodule has mapping relations with the series for searching in preset reply database The first return information.
In order to solve the above technical problems, the embodiment of the present invention also provides a kind of computer equipment, including memory and processing Device is stored with computer-readable instruction in the memory, when the computer-readable instruction is executed by the processor, so that The processor executes the step of language exchange method described above.
In order to solve the above technical problems, the embodiment of the present invention also provides a kind of storage Jie for being stored with computer-readable instruction Matter, when the computer-readable instruction is executed by one or more processors, so that one or more processors execute above-mentioned institute Predicate says the step of exchange method.
The beneficial effect of the embodiment of the present invention is: after the interaction request for getting terminal transmission, extracting in interaction request The text information is converted to the term vector square that can be identified by neural network model by the text information for indicating user's interaction wish After battle array, which is classified, and is obtained and interaction request phase according to classification results Corresponding return information.Due to, neural network model is of overall importance for the extraction of term vector matrix character, meanwhile, and warp After the extraction experience that training study several times obtains, therefore, neural network model can be accurately to expressed by text information User's interaction wish understands and classifies, and it is high to make classification results accuracy, and then improve the accuracy rate of return information.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those skilled in the art, without creative efforts, it can also be obtained according to these attached drawings other attached Figure.
Fig. 1 is the basic procedure schematic diagram of language of embodiment of the present invention exchange method;
Fig. 2 is the flow diagram that the embodiment of the present invention detects language interaction models return information;
Fig. 3 is the flow diagram that the embodiment of the present invention interacts request transmitting by covering connection;
Fig. 4 is the flow diagram that the embodiment of the present invention interacts processing by distributed server system;
Fig. 5 is the flow diagram that the embodiment of the present invention screens object transmission path;
Fig. 6 is the flow diagram that the embodiment of the present invention optimizes interactive system;
Fig. 7 is the flow diagram that the embodiment of the present invention extracts the first return information;
Fig. 8 is language of embodiment of the present invention interactive device basic structure schematic diagram;
Fig. 9 is computer equipment of embodiment of the present invention basic structure block diagram.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described.
In some processes of the description in description and claims of this specification and above-mentioned attached drawing, contain according to Multiple operations that particular order occurs, but it should be clearly understood that these operations can not be what appears in this article suitable according to its Sequence is executed or is executed parallel, and serial number of operation such as 101,102 etc. is only used for distinguishing each different operation, serial number It itself does not represent and any executes sequence.In addition, these processes may include more or fewer operations, and these operations can To execute or execute parallel in order.It should be noted that the description such as " first " herein, " second ", is for distinguishing not Same message, equipment, module etc., does not represent sequencing, does not also limit " first " and " second " and be different type.
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, those skilled in the art's every other implementation obtained without creative efforts Example, shall fall within the protection scope of the present invention.
Those skilled in the art of the present technique are appreciated that " terminal " used herein above, " terminal device " both include wireless communication The equipment of number receiver, only has the equipment of the wireless signal receiver of non-emissive ability, and including receiving and emitting hardware Equipment, have on bidirectional communication link, can execute two-way communication reception and emit hardware equipment.This equipment It may include: honeycomb or other communication equipments, shown with single line display or multi-line display or without multi-line The honeycomb of device or other communication equipments;PCS (Personal Communications Service, PCS Personal Communications System), can With combine voice, data processing, fax and/or communication ability;PDA (Personal Digital Assistant, it is personal Digital assistants), it may include radio frequency receiver, pager, the Internet/intranet access, web browser, notepad, day It goes through and/or GPS (Global Positioning System, global positioning system) receiver;Conventional laptop and/or palm Type computer or other equipment, have and/or the conventional laptop including radio frequency receiver and/or palmtop computer or its His equipment." terminal " used herein above, " terminal device " can be it is portable, can transport, be mounted on the vehicles (aviation, Sea-freight and/or land) in, or be suitable for and/or be configured in local runtime, and/or with distribution form, operate in the earth And/or any other position operation in space." terminal " used herein above, " terminal device " can also be communication terminal, on Network termination, music/video playback terminal, such as can be PDA, MID (Mobile Internet Device, mobile Internet Equipment) and/or mobile phone with music/video playing function, it is also possible to the equipment such as smart television, set-top box.
It is the basic procedure schematic diagram of the present embodiment language exchange method referring specifically to Fig. 1, Fig. 1.
As shown in Figure 1, a kind of language exchange method, comprising:
S1100, the interaction request that target terminal is sent is obtained, wherein include carrying user's interaction in the interaction request The text information of wish;
Receive the interaction request that target terminal is sent, wherein include the carrier for indicating user's interaction wish in interaction request Information, which can are as follows: text information or voice messaging.When carrier information is voice messaging, converted by voice Language message is converted text information by processing.
S1200, the text information is carried out to word segmentation processing generation participle collection, and participle collection is converted into term vector Matrix;
Word segmentation processing is carried out to text information, word segmentation processing refers to for a chinese character sequence being cut into one by one individually Word, participle are exactly the process that continuous word sequence is reassembled into word sequence according to certain specification.Word segmentation processing can adopt Segmenting method with (being not limited to) based on string matching, the segmenting method based on understanding or the segmenting method based on statistics.
Text information can be converted to one or more word by word segmentation processing, for example, when text information is " getting out of the way ", Word segmentation result is " getting out of the way " word;When the result that text information is " we now begin to play chat game " participle is " we " " present " " beginning " " object for appreciation " " chat game ".In some embodiments, participle can also be used with small granularity, The smaller of word point is said, for example, the result of " we now begin to play chat game " participle are as follows: " we " " present " " beginning " " object for appreciation " " chat " " game ".Word segmentation result is to generate the participle collection being made of one or more word after word segmentation processing.
The each word for saying that participle is concentrated after the completion of word segmentation processing is converted to term vector (Word embedding), term vector It is called the general designation of one group of Language Modeling and feature learning technology in the embedded natural language processing of Word (NLP), wherein coming from The word or expression of vocabulary is mapped to the vector of real number.The tool of term vector conversion can use (being not limited to) The application software such as Word2vec, GloVe, fastText, Gensim, Indra and Deeplearning4j.
Each word that participle is concentrated is converted to corresponding term vector, then segments collection and be converted to and be made of term vector Term vector matrix.Each word or word for constituting participle collection, are mapped an element for replacing with term vector matrix, and The arrangement order of element is consistent with the arrangement order of word each in text information.
S1300, by the term vector Input matrix into preset language interaction models, wherein language interaction mould Type is that training is used for the neural network model classified to natural language to convergence state in advance;
Term vector Input matrix is subjected to feature extraction and classifying into language interaction models.Language interaction models can be The trained convolutional neural networks model (CNN) to convergence state, still, not limited to this, language interaction models can also It is: the distorted pattern of deep neural network model (DNN), Recognition with Recurrent Neural Network model (RNN) or above-mentioned three kinds of network models.
Initial neural network model as language interaction models is in training, by collecting a large amount of interaction text information Term vector matrix after conversion is as training sample, by manually after the interaction text information for having read training sample to each Training sample is demarcated (classification results for demarcating each training sample).Then training sample is input to initial nerve net In network model, neural network model extracts the feature vector of the training sample, and by the classification class of this feature vector and classification layer Mesh is compared, and obtains the confidence level between feature vector and each series, and the highest series of confidence level is point Class result.For example, series is (being not limited to): " telling a story ", " listening to music ", " coming along " and " dancing " etc..
Obtain classification results (the classification knot for the interaction text information that classification results are calculated for model of model output Fruit), and by the loss function of neural network model calculate the distance between the classification results and calibration result (such as: Euclidean Distance, mahalanobis distance or COS distance etc.), by calculated result and the distance threshold of setting, (value of distance threshold is handed over to speech The accuracy rate of mutual model is inversely proportional, i.e., accuracy rate requires higher, and the value of distance threshold is lower) it is compared, if calculated result Then pass through verifying less than or equal to distance threshold, continue the training of next training sample, if calculated result is greater than apart from threshold Value then calculates difference between the two by loss function, and corrects the weight in neural network model by backpropagation, Neural network model is set to can be improved the corresponding element of term vector that can accurately express interactive text information method in training sample Weight the accuracy rate of extraction and comprehensive is increased with this.Above scheme and the training of a large amount of training sample are executed by circulation Afterwards, the accuracy rate that training obtained neural network model classify to term vector is greater than certain numerical value, for example, 95%, then the mind Through network model training to convergence state, then the training to convergent neural network is language interaction models.
The language interaction models of training to convergence state accurately can carry out series to term vector.
S1400, the first of the interaction request is obtained according to the classification results that the language interaction models export and is replied and is believed Breath, wherein the classification results are series belonging to the text information, and the series is mapped with described first time Complex information.
According to the classification results of the text information of language interaction models output, first time for replying user's interaction request is obtained Complex information, wherein the content that the first return information is recorded is the answer that the user's interaction wish indicated for text information provides. It is different for expression way for the difference for coping with different user Expression of language in present embodiment, but the meaning of its expression Think consistent text information, identifies whether it has consistent declaration of will according to the mode of classification, the table if so, it looks like Show consistent;If it is not, the series then belonging to them is not identical.Due to what the text information in same series indicated User's meaning is consistent, and therefore, sets the first corresponding return information for of a sort series, can be to this Say that all text informations are replied under series.
For example, the interactive information that the text information of user indicates is following question informations " who are you? " " you cry assorted ? " " yours is named as what? " " what you cry? " the problem of Deng robot title is putd question to, can be classified to point of " your name " In class classification, corresponding first return information of the series is that " you are good, mine is named as siri ".No matter what user uses The name of the expression way inquiry robot of sample, being all made of the first return information is that " you are good, my siri " that is named as is returned It is multiple.
It should be pointed out that the first return information can be writing text or voice messaging, according to user's interaction request Mode select the format of the first return information, when interaction request is writing text, the first return information is also writing text;It hands over When mutually request is voice messaging, the first return information is also phonetic matrix.
In some embodiments, a series is mapped with multiple first return informations, in order to identify use After environment locating for family, corresponding first return information is selected to be replied.For example, the first return information is voice messaging When, the first return information of the corresponding two kinds of genders of series is replied that is, when user is women by the voice messaging of women When user is male, the interaction request of user is replied by the voice messaging of male for the interaction request of user;Or when user is When women, the interaction request of user is replied by the voice messaging of male, when user is male, passes through the voice messaging of women The interaction request of user is replied, the content of the first return information is identical in addition to sound.
For above embodiment after the interaction request for getting terminal transmission, extracting indicates user's interaction meaning in interaction request The text information of hope, by the text information be converted to can by neural network model identify term vector matrix after, by the word to Moment matrix is input to neural network model and classifies, and obtains reply corresponding with interaction request according to classification results and believe Breath.Since, neural network model is of overall importance for the extraction of term vector matrix character, meanwhile and process train several times Learn obtained extraction experience, therefore, neural network model can be accurately to the interaction wish of user expressed by text information Understood and classified, it is high to make classification results accuracy, and then improve the accuracy rate of return information.
In some embodiments it may be desirable to be detected to the return information of language interaction models, to prevent language interaction Is there is the case where replying of getting lines crossed in the larger situation of data processing pressure in model.Referring to Fig. 2, Fig. 2 is that the present embodiment detects language Say the flow diagram of interaction models return information.
As shown in Fig. 2, after S1400 step shown in Fig. 1, comprising:
S1411, it searches in preset interactive map list using the text information as qualifications and believes with the text Cease second return information with mapping relations, wherein second return information is that the standard of the text information is replied;
It is provided with the interactive map list of full dose in present embodiment, records some application scenarios in the interactive map list In, user is possible to the return information of all the problems proposed, and has corresponding relationship between problem information and return information.It is right It is putd question in the user for not meeting logic of language partially or beyond the enquirement except application scenarios, unified return information is equal Are as follows: the return informations such as " I does not mention clear " or " I does not know, so I cannot answer ".
When the interaction request for the transmission for getting target terminal, and by parsing after obtain text information after, with the text The content of information is search condition, and the corresponding return information of the text information, the return information are searched in interactive map list It is defined as the second return information, since the second return information is corresponding reply letter in the interactive map list artificially made Breath, therefore, the second return information are that the standard of text information is replied.
Whether S1412, comparison first return information and second return information are consistent;
Compare whether the first return information is consistent with the second return information by way of comparison, the mode of comparison is to calculate Whether Hamming distance or Hamming distances between the first return information and the second return information are 0, if 0, then first reply letter Breath is consistent with the second return information, if not 0, then the first return information and the second return information are inconsistent.
S1413, when first return information and second return information it is inconsistent when, Xiang Suoshu target terminal send Second return information.
Confirm that mistake of getting lines crossed are occurring in language interaction models when the first return information and inconsistent the second return information.This When, the second return information is sent to target terminal, avoids sending incorrect return information to user due to getting lines crossed.
It is exercised supervision by the return information that language interaction models are made in interactive map list, is conducive to optimize language friendship Mutual model, while the accuracy rate of return information is improved, enhance user experience effect.
In some embodiments, the connection between target terminal and server end is connected by set, in order to service Drug case, which is established, in device end and multiple targets interconnects.Referring to Fig. 3, Fig. 3 is that the present embodiment is asked by covering to connect to interact Seek the flow diagram of transmitting.
As shown in figure 3, S1100 shown in FIG. 1 includes:
The interaction channel that S1111, calling pre-establish, wherein the interaction channel is that the set established with target terminal connects It connects;
The connection procedure of set connection between server end and target terminal are as follows: the socket and delocalization tool of server end The target terminal socket of body, but in the state for waiting connection, monitor network state in real time.The socket of target terminal mentions Connection request out, the target to be connected are the sockets of server end.For this purpose, the socket of target terminal must describe it first The socket for the server to be connected, it is indicated that the then address of server side socket and port numbers are just socketed to server end Word proposes connection request.The connection request of target terminal socket is received in other words when server side socket listens to, it The request of target terminal socket just is responded, establishes a new thread, target end is issued in the description of server side socket End, once target terminal confirmed that this description, connection just establish.And server side socket keeps listening state, Continue to the connection request of other target terminal sockets.
After the completion of the connection of the set of target terminal and server end, by calling set connection to be just able to carry out interaction data Transmission.
Since a thread task is established in each set connection, then server end can be realized as by multithreading task The task that multiple target terminals interact simultaneously.
S1112, the interaction request that the target terminal uploads is obtained according to the interaction channel.
According to the interaction channel having built up, target terminal is by interactive request upload to server end.Target terminal and clothes Set connection between business device end can not only realize that multi-thread concurrent executes multiple interactive tasks, meanwhile, it reduces between channel Intersection caused by get lines crossed probability, improve the accuracy rate of system return information.
In some embodiments, server end constructs distributed server system, i.e., by different micro process center point Cloth has system smart allocation node is unified to be allocated to processing task, in different regions to mitigate individual server Service pressure, improve interactive efficiency.Referring to Fig. 4, Fig. 4 is that the present embodiment is handed over by distributed server system The flow diagram mutually handled.
As shown in figure 4, before S1200 step shown in FIG. 1, comprising:
S1121, the location information for obtaining the target terminal;
It include the location information of target terminal in present embodiment, in interaction request, target terminal in present embodiment Location information can be the actual position coordinate of target terminal, but location information is not limited to this, according to concrete application scene Difference, in some embodiments, location information can be the positions of the IP address characterization of target terminal.
S1122, according to the positional information by the interaction request distribute to the location information have it is jurisdictional Handle node, wherein the processing node is the regional processing center of distributed server system;
In present embodiment, the server end responded to interaction request is distributed server system.Distribution clothes It is engaged in device service system, each server or server cluster are the service node of distributed server system.Each clothes Other nodes all have identical job function to part management node (such as smart allocation node) outside at business node, but each Service node is distributed in different regions.Be able to carry out between each service node data transmission, each service node and its It is connected between one or more adjacent service node by transmission link.Each service node is distributed server system Unified server-centric, the interactive information processing function being responsible in a region.
According to the location information of target terminal, the service node of the smart allocation node allocation processing interaction request, the clothes Business node is defined processing node.The method of salary distribution are as follows: by the location information where target terminal, determine and have to the interaction request The processing node having jurisdiction, and interaction request is distributed to processing node and is handled.
S1123, the interaction request is sent to the processing node, so that the processing node is to the interaction request It is responded.
After the processing node that transmission interaction request has been determined, interaction request is sent to processing node, handles node pair Interaction request is handled, and processing result is generated return information, which can are as follows: the first return information or second Return information.
Distributed server system improves the data throughput capabilities of internet, improves to target terminal interaction request Response speed.
In some embodiments, it in order to further improve the response speed of distributed system, needs to interaction request Transmission path in distributed server system is screened, in order to which interaction request is sent to processing in the shortest possible time Node is handled.Referring to Fig. 5, Fig. 5 is the flow diagram that the present embodiment screens object transmission path.
As shown in figure 5, S1123 step shown in Fig. 4 includes:
S1131, acquisition go to the object transmission path of the processing node, wherein the object transmission path is to go to The shortest transmission path of the processing time on node;
Due to data transmission being able to carry out between each service node, therefore, from intelligence in distributed server system The path that interaction request is transmitted to processing node is had a plurality of by distribution node, and the link layer between every two node is designated as one Transmission link.
After it confirmed the transmission link of transmission path and each transmission path of composition of transmission interaction request, obtain each The progress information of a transmission link, progress information are to send out in transmission link as the service node response data of data receiver The response time of sending end.
After the response time for obtaining each transmission link, calculated according to dijkstra's algorithm (Dijkstra's algorithm) Object transmission path is calculated using dijkstra's algorithm from smart allocation node to object transmission path, mesh processing node Mark transmission path is the shortest transmission path of path overall response duration.
S1132, the interaction request is sent to by the processing node according to the object transmission path, so that the place Reason node responds the interaction request.
According to determining object transmission path, interaction request is sent to processing node, processing node to interaction request into Row processing, and processing result is generated into return information, which can are as follows: the first return information or the second return information. Return information passes through object transmission path backtracking to smart allocation node.
It selects the shortest transmission path of overall response duration for object transmission path in numerous transmission paths, improves interaction The efficiency of transmission of request.
In some embodiments, interaction request is used for the application scenarios of daily man-machine chat, for interactive system Can a judgment criteria be, the duration of user's access interaction system, if quickly being exited after user's access interaction system, table Show that interactive system existing defects needs optimize.Referring to Fig. 6, Fig. 6 is the process signal that the present embodiment optimizes interactive system Figure.
As shown in fig. 6, after S1400 shown in FIG. 1, comprising:
S1421, the connection duration for obtaining the interaction channel;
In present embodiment, it is interactive progress when target terminal does not disconnect actively that interaction channel, which is set connection, When, target terminal sends the timestamp of interaction request when obtaining interaction channel connection, then obtains to disconnect when interaction channel disconnects and ask The timestamp asked, the when a length of connection duration between two timestamps.
S1422, the connection duration is compared with preset first time threshold;
Connection duration is compared with first time threshold, wherein first time threshold be measurement interactive quality when Between be worth.The value of first time threshold can be 5min, but not limited to this, according to the difference of concrete application scene, first The value of time threshold can be larger or smaller.
S1423, when the connection duration be less than the first time threshold when, reselecting has with the series First return information of mapping relations.
When length is less than preset first time threshold when attached, that is, shows that interactive experience is limited, user can not be caused to hand over Mutual desire needs the return information for the problem of proposing again to user to modify.In some embodiments, first is modified Return information modifies the first return information of the last item that interactive system is sent to target terminal.In some embodiments, Modification interactive system is sent to all first return informations of target terminal.
By the way that interaction duration is recorded and compared, whether confirmation interactive system has enough attractions to user, And after the answer for being negated, modify to return information, to optimize interactive system, improves the interactive experience of user.
In some embodiments, the first return information corresponding with series is stored in reply database, by looking into Look for the first return information of confirmation.Referring to Fig. 7, Fig. 7 is the flow diagram that the present embodiment extracts the first return information.
As shown in fig. 7, S1400 step shown in FIG. 1 includes:
S1431, the series for obtaining the text information that the language interaction models export;
The classification results of the text information of language interaction models output are obtained, classification results specifically refer to language interaction models Series belonging to the text information classified to text information.
S1432, it searches first that there are mapping relations with the series in preset reply database and replys and believe Breath.
Database is replied in setting in present embodiment, restores to store information, data pair in a manner of data pair in database Including a series and the first return information corresponding with series, therefore, can replied by series The first return information that series has mapping relations is found in database.
In order to solve the above technical problems, the embodiment of the present invention also provides a kind of language interactive device.
It is the present embodiment language interactive device basic structure schematic diagram referring specifically to Fig. 8, Fig. 8.
As shown in figure 8, a kind of language interactive device, comprising: obtain module 2100, processing module 2200, categorization module 2300 and execution module 2400.Wherein, the interaction request that module 2100 is used to obtain target terminal transmission is obtained, wherein interaction It include the text information of carrying user's interaction wish in request;Processing module 2200 is used to text information carrying out word segmentation processing raw Ingredient word set, and participle collection is converted into term vector matrix;Categorization module 2300 is used for term vector Input matrix to preset In language interaction models, wherein the training in advance of language interaction models is to convergence state for classifying to natural language Neural network model;The classification results that execution module 2400 is used to be exported according to language interaction models obtain the first of interaction request Return information, wherein classification results are series belonging to text information, and series is mapped with the first return information.
For language interactive device after the interaction request for getting terminal transmission, extracting indicates user's interaction meaning in interaction request The text information of hope, by the text information be converted to can by neural network model identify term vector matrix after, by the word to Moment matrix is input to neural network model and classifies, and obtains reply corresponding with interaction request according to classification results and believe Breath.Since, neural network model is of overall importance for the extraction of term vector matrix character, meanwhile and process train several times Learn obtained extraction experience, therefore, neural network model can be accurately to the interaction wish of user expressed by text information Understood and classified, it is high to make classification results accuracy, and then improve the accuracy rate of return information.
In some embodiments, language interactive device further include: the first processing submodule, first compare submodule and the One implementation sub-module.Wherein, the first processing submodule is used to using text information be qualifications in preset interactive map list Middle lookup has the second return information of mapping relations with text information, wherein the second return information is the standard of text information It replys;Whether the first comparison submodule is consistent for comparing the first return information and the second return information;First implementation sub-module For sending the second return information to target terminal when the first return information and inconsistent the second return information.
In some embodiments, language interactive device further include: second processing submodule and the second implementation sub-module.Its In, second processing submodule is for calling the interaction channel pre-established, wherein interaction channel is the set established with target terminal Connection;Second implementation sub-module is used to obtain the interaction request that target terminal uploads according to interaction channel.
It in some embodiments, include the location information of target terminal, language interactive device in interaction request further include: First acquisition submodule, third processing submodule and third implementation sub-module.Wherein, the first acquisition submodule is for obtaining target The location information of terminal;Third processing submodule, which is used to be distributed interaction request to location information according to location information, has pipe Have jurisdiction over the processing node of power, wherein processing node is the regional processing center of distributed server system;Third implementation sub-module For interaction request to be sent to processing node, so that processing node responds interaction request.
In some embodiments, language interactive device further include: the second acquisition submodule and the 4th implementation sub-module.Its In, the second acquisition submodule is used to obtain the object transmission path for going to processing node, wherein object transmission path is to go to place Manage the shortest transmission path of time on node;4th implementation sub-module is used to that interaction request to be sent to place according to object transmission path Node is managed, so that processing node responds interaction request.
In some embodiments, language interactive device further include: third acquisition submodule, second compare submodule and the Five implementation sub-modules.Wherein, third acquisition submodule is used to obtain the connection duration of interaction channel;Second comparison submodule is used for Connection duration is compared with preset first time threshold;When 5th implementation sub-module for growing less than first when attached Between threshold value when, reselect with series have mapping relations the first return information.
In some embodiments, language interactive device further include: the 4th acquisition submodule and fourth process submodule.Its In, the 4th acquisition submodule is used to obtain the series of the text information of language interaction models output;Fourth process submodule For searching the first return information that there are mapping relations with series in preset reply database.
In order to solve the above technical problems, the embodiment of the present invention also provides computer equipment.It is this referring specifically to Fig. 9, Fig. 9 Embodiment computer equipment basic structure block diagram.
As shown in figure 9, the schematic diagram of internal structure of computer equipment.The computer equipment includes being connected by system bus Processor, non-volatile memory medium, memory and network interface.Wherein, the non-volatile memories of the computer equipment are situated between Matter is stored with operating system, database and computer-readable instruction, can be stored with control information sequence in database, the computer When readable instruction is executed by processor, processor may make to realize a kind of language exchange method.The processor of the computer equipment For providing calculating and control ability, the operation of entire computer equipment is supported.It can be stored in the memory of the computer equipment There is computer-readable instruction, when which is executed by processor, processor may make to execute a kind of language interaction Method.The network interface of the computer equipment is used for and terminal connection communication.It will be understood by those skilled in the art that showing in Fig. 9 Structure out, only the block diagram of part-structure relevant to application scheme, does not constitute and is applied to application scheme The restriction of computer equipment thereon, specific computer equipment may include than more or fewer components as shown in the figure, or Person combines certain components, or with different component layouts.
Processor is for executing acquisition module 2100, processing module 2200, categorization module 2300 in Fig. 8 in present embodiment With the concrete function of execution module 2400, program code and Various types of data needed for memory is stored with the above-mentioned module of execution.Net Network interface is used for the data transmission between user terminal or server.Memory in present embodiment is stored with facial image Program code needed for executing all submodules in critical point detection device and data, server are capable of the program of invoking server Code and data execute the function of all submodules.
For computer equipment after the interaction request for getting terminal transmission, extracting indicates user's interaction wish in interaction request Text information, by the text information be converted to can by neural network model identify term vector matrix after, by the term vector Input matrix to neural network model is classified, and obtains return information corresponding with interaction request according to classification results. Due to, neural network model is of overall importance for the extraction of term vector matrix character, meanwhile, and by training study several times Obtained extraction experience, therefore, neural network model can accurately carry out the interaction wish of user expressed by text information Understand and classify, it is high to make classification results accuracy, and then improve the accuracy rate of return information.
The present invention also provides a kind of storage medium for being stored with computer-readable instruction, computer-readable instruction by one or When multiple processors execute, so that the step of one or more processors execute any of the above-described embodiment language exchange method.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, which can be stored in a computer-readable storage and be situated between In matter, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, storage medium above-mentioned can be The non-volatile memory mediums such as magnetic disk, CD, read-only memory (Read-Only Memory, ROM) or random storage note Recall body (Random Access Memory, RAM) etc..
It should be understood that although each step in the flow chart of attached drawing is successively shown according to the instruction of arrow, These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps Execution there is no stringent sequences to limit, can execute in the other order.Moreover, at least one in the flow chart of attached drawing Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps Completion is executed, but can be executed at different times, execution sequence, which is also not necessarily, successively to be carried out, but can be with other At least part of the sub-step or stage of step or other steps executes in turn or alternately.

Claims (10)

1. a kind of language exchange method characterized by comprising
Obtain the interaction request that target terminal is sent, wherein include the text of carrying user's interaction wish in the interaction request Information;
The text information is subjected to word segmentation processing and generates participle collection, and participle collection is converted into term vector matrix;
By the term vector Input matrix into preset language interaction models, wherein the language interaction models are to instruct in advance Practice the neural network model for being used to classify to natural language to convergence state;
The first return information of the interaction request is obtained according to the classification results that the language interaction models export, wherein institute Stating classification results is series belonging to the text information, and the series is mapped with first return information.
2. language exchange method according to claim 1, which is characterized in that described to be exported according to the language interaction models Classification results obtain the first return information of the interaction request after, comprising:
Searching in preset interactive map list using the text information as qualifications has mapping with the text information Second return information of relationship, wherein second return information is that the standard of the text information is replied;
It compares first return information and whether second return information is consistent;
When first return information and second return information are inconsistent, Xiang Suoshu target terminal is sent described second time Complex information.
3. language exchange method according to claim 1, which is characterized in that the interaction for obtaining target terminal transmission is asked It asks and includes:
Call the interaction channel pre-established, wherein the interaction channel is that the set established with target terminal is connect;
The interaction request that the target terminal uploads is obtained according to the interaction channel.
4. language exchange method according to claim 3, which is characterized in that include that the target is whole in the interaction request The location information at end;It is described that the text information is subjected to word segmentation processing generation participle collection, and participle collection is converted into word Before vector matrix, comprising:
Obtain the location information of the target terminal;
The interaction request, which is distributed to the location information, according to the positional information has jurisdictional processing node, In, the processing node is the regional processing center of distributed server system;
The interaction request is sent to the processing node, so that the processing node responds the interaction request.
5. language exchange method according to claim 4, which is characterized in that it is described the interaction request is sent to it is described Handle node so that the processing node to the interaction request carry out respond include:
Obtain the object transmission path for going to the processing node, wherein the object transmission path is that the processing is gone to save Point used time shortest transmission path;
The interaction request is sent to the processing node according to the object transmission path, so that the processing node is to institute Interaction request is stated to be responded.
6. language exchange method according to claim 3, which is characterized in that described to be exported according to the language interaction models Classification results obtain the first return information of the interaction request after, comprising:
Obtain the connection duration of the interaction channel;
The connection duration is compared with preset first time threshold;
When the connection duration is less than the first time threshold, reselecting has mapping relations with the series First return information.
7. language exchange method according to claim 1, which is characterized in that described to be exported according to the language interaction models Classification results obtain the first return information of the interaction request and include:
Obtain the series of the text information of the language interaction models output;
The first return information that there are mapping relations with the series is searched in preset reply database.
8. a kind of language interactive device characterized by comprising
Module is obtained, for obtaining the interaction request of target terminal transmission, wherein include that carrying user hands in the interaction request The text information of mutual wish;
Processing module generates participle collection for the text information to be carried out word segmentation processing, and participle collection is converted to word Vector matrix;
Categorization module is used for the term vector Input matrix into preset language interaction models, wherein the language interaction Model is that training is used for the neural network model classified to natural language to convergence state in advance;
Execution module, the classification results for being exported according to the language interaction models obtain the first reply of the interaction request Information, wherein the classification results are series belonging to the text information, and the series is mapped with described first Return information.
9. a kind of computer equipment, including memory and processor, it is stored with computer-readable instruction in the memory, it is described When computer-readable instruction is executed by the processor, so that the processor executes such as any one of claims 1 to 7 right It is required that the step of language exchange method.
10. a kind of storage medium for being stored with computer-readable instruction, the computer-readable instruction is handled by one or more When device executes, so that one or more processors execute the language interaction side as described in any one of claims 1 to 7 claim The step of method.
CN201910198999.8A 2019-03-15 2019-03-15 Language exchange method, device, computer equipment and storage medium Pending CN110110040A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910198999.8A CN110110040A (en) 2019-03-15 2019-03-15 Language exchange method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910198999.8A CN110110040A (en) 2019-03-15 2019-03-15 Language exchange method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110110040A true CN110110040A (en) 2019-08-09

Family

ID=67484333

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910198999.8A Pending CN110110040A (en) 2019-03-15 2019-03-15 Language exchange method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110110040A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110931012A (en) * 2019-10-12 2020-03-27 深圳壹账通智能科技有限公司 Reply message generation method and device, computer equipment and storage medium
CN111680142A (en) * 2020-05-29 2020-09-18 平安普惠企业管理有限公司 Automatic answering method and device based on text recognition and computer equipment
WO2021051404A1 (en) * 2019-09-20 2021-03-25 Beijing Didi Infinity Technology And Development Co., Ltd. Systems and methods for auxiliary reply

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109446304A (en) * 2018-10-10 2019-03-08 长沙师范学院 Intelligent customer service session method and system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109446304A (en) * 2018-10-10 2019-03-08 长沙师范学院 Intelligent customer service session method and system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021051404A1 (en) * 2019-09-20 2021-03-25 Beijing Didi Infinity Technology And Development Co., Ltd. Systems and methods for auxiliary reply
CN110931012A (en) * 2019-10-12 2020-03-27 深圳壹账通智能科技有限公司 Reply message generation method and device, computer equipment and storage medium
CN111680142A (en) * 2020-05-29 2020-09-18 平安普惠企业管理有限公司 Automatic answering method and device based on text recognition and computer equipment

Similar Documents

Publication Publication Date Title
US20200301954A1 (en) Reply information obtaining method and apparatus
Lee et al. Stochastic multiple choice learning for training diverse deep ensembles
CN110110040A (en) Language exchange method, device, computer equipment and storage medium
CN109643325B (en) Recommending friends in automatic chat
CN108269110B (en) Community question and answer based item recommendation method and system and user equipment
CN109684478A (en) Disaggregated model training method, classification method and device, equipment and medium
WO2021139243A1 (en) Data processing method, device, and apparatus employing human-computer interaction, and storage medium
CN110334245A (en) A kind of short video recommendation method and device of the figure neural network based on Temporal Order
CN107251060A (en) For the pre-training and/or transfer learning of sequence label device
CN106570181B (en) Intelligent interaction method and system based on context management
WO2019214453A1 (en) Content sharing system, method, labeling method, server and terminal device
WO2017183242A1 (en) Information processing device and information processing method
CN109960722A (en) A kind of information processing method and device
Du et al. YOLO-based semantic communication with generative AI-aided resource allocation for digital twins construction
CN107515857A (en) Semantic understanding method and system based on customization technical ability
KR20190023316A (en) Question-answering system based dialogue model
Aiyuan et al. An artificial intelligence recognition model for English online teaching
Wang et al. Cross-agent action recognition
CN112580750A (en) Image recognition method and device, electronic equipment and storage medium
CN114329181A (en) Question recommendation method and device and electronic equipment
CN114302157A (en) Attribute tag identification and multicast event detection method, device, equipment and medium
CN115487508B (en) Training method and related device for game team recommendation model
CN116881416A (en) Instance-level cross-modal retrieval method for relational reasoning and cross-modal independent matching network
KR20210047047A (en) System and method for managing of material warehouse by using speech recognition, and computer readable storage medium storing the same
CN109743548A (en) The public security platform that commands troops

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