Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, a first object of the present invention is to provide an automatic information reply method, so as to obtain the call information of a communication object by using contact data and context semantic information and add the call information to a quick reply sentence, so that the call in the quick reply more meets the user expectation, the accuracy of the quick reply is improved, and the quick reply function is more intelligent and personalized.
The second objective of the present invention is to provide an automatic message replying device.
A third object of the present invention is to provide a terminal device.
A fourth object of the invention is to propose a computer program product.
A fifth object of the invention is to propose a non-transitory computer-readable storage medium.
To achieve the above object, an embodiment of a first aspect of the present invention provides an automatic information replying method, including:
analyzing context information of a current user and a communication object through an application program according to a natural language processing model, and automatically generating one or more reply contents;
analyzing and identifying a first name of the communication object according to the name corpus of the context information, and reading a second name of the communication object according to the application setting information of the application program;
comparing whether the first name and the second name are the same or not, if the first name and the second name are different, respectively inserting the first name and the second name into the calling position of each reply content, and generating a plurality of candidate reply messages;
and acquiring target reply information selected by the current user from the candidate reply information, and sending the target reply information to the communication object through the application program.
In addition, the automatic information reply method according to the above embodiment of the present invention may further have the following additional technical features:
optionally, the reading the second name of the communication object according to the application setting information of the application program includes:
and reading the second name of the communication object from the contact name control according to the application page setting information of the application program.
Optionally, the reading the second name of the communication object according to the application setting information of the application program includes:
and reading the second name of the communication object from a registered name control according to the application registration setting information of the application program.
Optionally, after the comparing whether the first name and the second name are the same, the method further includes: if the first name is the same as the second name through comparison, carrying out duplicate removal processing on the first name and the second name;
and inserting the first name or the second name into the call position of each reply content to generate one or more candidate reply messages.
Optionally, the method further includes:
and acquiring parameter information of the target reply information training network neural model selected by the current user in a preset time period, and generating a name scoring model.
Optionally, after the first name and the second name are respectively inserted into the call location of each reply content, and a plurality of candidate reply messages are generated, the method further includes:
scoring the candidate reply information corresponding to the first name and the candidate reply information corresponding to the second name according to the name scoring model;
and deleting the candidate reply information with low score according to the scoring result, and providing the candidate reply information with high score for the user.
Optionally, the method further includes:
judging whether a third name corresponding to the communication object is set and stored in an automatic information reply function of the current user, wherein the priority of the third name is higher than that of the first name and that of the second name;
if the fact that the current user does not set the third name in the automatic information reply function is known, the first name of the communication object is identified according to name corpus analysis of the context information;
and if the third name is set in the automatic information reply function by the current user, inserting the third name into the call position of each reply content to generate one or more candidate reply information.
In order to achieve the above object, a second aspect of the present invention provides an automatic information replying device, including:
the first generation module is used for analyzing the context information of the current user and the communication object through the application program according to the natural language processing model and automatically generating one or more reply contents;
the obtaining module is used for analyzing and identifying a first name of the communication object according to the name corpus of the context information and reading a second name of the communication object according to the application setting information of the application program;
the processing module is used for comparing whether the first name and the second name are the same or not; a second generating module, configured to insert the first name and the second name into a call location of each reply content, if it is known that the first name and the second name are different, and generate multiple candidate reply messages;
and the sending module is used for acquiring the target reply information selected by the current user from the candidate reply information and sending the target reply information to the communication object through the application program.
Optionally, the obtaining module is specifically configured to: and reading the second name of the communication object from the contact name control according to the application page setting information of the application program.
Optionally, the obtaining module is specifically configured to: and reading the second name of the communication object from a registered name control according to the application registration setting information of the application program.
Optionally, the second generating module is further configured to: if the first name is the same as the second name through comparison, carrying out duplicate removal processing on the first name and the second name; and inserting the first name or the second name into the call position of each reply content to generate one or more candidate reply messages.
Optionally, the apparatus further includes:
and the third generation module is used for acquiring parameter information of the target reply information training network neural model selected by the current user in a preset time period and generating a name scoring model.
Optionally, the apparatus further includes:
the screening module is used for scoring the candidate reply information corresponding to the first name and the candidate reply information corresponding to the second name according to the name scoring model; and deleting the candidate reply information with low score according to the scoring result, and providing the candidate reply information with high score for the user.
Optionally, the apparatus further includes:
a fourth generating module, configured to determine whether a third name corresponding to the communication object is set and stored in an automatic information reply function of the current user, where a priority of the third name is higher than the first name and the second name;
if the fact that the current user does not set the third name in the automatic information reply function is known, the first name of the communication object is identified according to name corpus analysis of the context information;
and if the third name is set in the automatic information reply function by the current user, inserting the third name into the call position of each reply content to generate one or more candidate reply information.
To achieve the above object, a third embodiment of the present invention provides a terminal device, including a processor and a memory; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the automatic information replying method according to the embodiment of the first aspect.
To achieve the above object, a fourth aspect of the present invention provides a computer program product, wherein when being executed by an instruction processor of the computer program product, the method for automatically replying information according to the first aspect is implemented.
To achieve the above object, a fifth embodiment of the present invention provides a non-transitory computer-readable storage medium, having a computer program stored thereon, where the computer program is executed by a processor to implement the method for automatically replying to information according to the first embodiment.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
analyzing context information of a current user and a communication object through an application program according to a natural language processing model, automatically generating one or more reply contents, further analyzing and identifying a first name of the communication object according to name corpus of the context information, reading a second name of the communication object according to application setting information of the application program, further comparing whether the first name is the same as the second name, if the first name is different from the second name, respectively inserting the first name and the second name into the calling position of each reply content, generating a plurality of candidate reply information, further acquiring target reply information selected by the current user from the candidate reply information, and sending the target reply information to the communication object through the application program. Therefore, by utilizing the contact data and the context semantic information, the call information of the communication object is acquired and added into the quick reply sentence, so that the call in the quick reply is more in line with the user expectation, the accuracy of the quick reply is improved, and the quick reply function is more intelligent and personalized.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The following describes an automatic information reply method, apparatus, and device according to an embodiment of the present invention with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of an automatic information replying method according to an embodiment of the present invention, as shown in fig. 1, the automatic information replying method includes:
step 101, analyzing context information of a current user and a communication object through an application program according to a natural language processing model, and automatically generating one or more reply contents.
Optionally, training data may be formed by collecting natural language sentences input by a sample user, and the machine learning model is trained by using the training data, so as to obtain a natural language processing model capable of generating reply content.
Further, when the current user communicates with the communication object through the application program, the context information of the current user and the communication object is identified and analyzed according to the trained natural language processing model, and therefore one or more reply contents are automatically generated. For example, after the context information "Happy birthday" is subjected to recognition analysis according to the natural language processing model, reply contents such as "Thank you", "Thanks babe", "Thanks for eating of me" and the like may be automatically generated.
And 102, identifying a first name of the communication object according to the name corpus analysis of the context information, and reading a second name of the communication object according to the application setting information of the application program.
It can be understood that, the natural language processing model in the related art is obtained by training corpus data of a large number of sample users, and when the names of communication objects are involved in the reply content, there is often no pertinence, for example, words with a wider range such as "babe" are used, and the names of the words often do not meet the user expectations for the users, so that, in order to make the name information in the reply content more meet the user expectations, after one or more reply contents are generated, name information of the communication objects can be obtained from the name corpus of the context information and the contact name control.
As an example, the name corpus in the context information may be identified and analyzed through a natural language processing technique, so as to obtain the name information of the communication object by the user, and the name information is used as the first name of the communication object. For example, by identifying and analyzing "bye mom" in the context information, "mom" can be obtained as the first name of the communication object.
As an example, the contact name information of the communication object may be read from the contact name control as the second name of the communication object according to the application page setting information of the application program through a Hypertext Markup Language (HTML) 5 technology. For example, when the application program is a mobile phone short message, the HTML5 may be used to parse the contact name control of the short message chat interface, so as to read the contact name information of the communication object, and use the contact name information as the second name of the communication object.
As an example, it is also possible to read the registration name information of the communication object from the registration name control as the second name of the communication object by the HTML5 technique according to the application registration setting information of the application program. For example, when the application program is a WeChat, if the WeChat is registered through a mobile phone number, the registration name control set in the registration interface may be further analyzed through the HTML5 to read the registration name information of the communication object, and the registration name information is used as the second name of the communication object, so that the name information of the communication object set in the mobile phone is synchronized into the WeChat.
And 103, comparing whether the first name is the same as the second name, if the first name is different from the second name, respectively inserting the first name and the second name into the calling position of each reply content, and generating a plurality of candidate reply messages.
In an embodiment of the present invention, if the first name and the second name are found to be different from each other by comparison, the first name and the second name are respectively inserted into the call location of each reply content to generate a plurality of candidate reply messages, so as to provide diversified candidate reply messages for the user. For example, as shown in fig. 2a, the context information "moving beauty" is analyzed according to the natural language processing model, the reply contents "Hey", "Hi", and "Hello" are automatically generated, the first name of the communication object is identified according to the name corpus analysis of the context information, "mom", the second name of the communication object is read from the contact name control according to the page setting information of the application program, the first name and the second name are inserted into the calling position of each reply content respectively by comparing to know that the first name is different from the second name, and the candidate reply information "Hey mom", "Hi mom", "Hello", "Hey Ellie", "Hi Ellie", and "Hello Ellie" are generated.
In another embodiment of the present invention, when the first name is identical to the second name, the user experience is improved to avoid repeated display, and the first name and the second name may be subjected to deduplication processing. And further, inserting the first name or the second name after the duplication removal into the calling position of each reply content to generate one or more candidate reply messages. For example, as shown in fig. 2b, the context information "moving beauty" is analyzed according to the natural language processing model, the reply contents "Hey", "Hi", and "Hello" are automatically generated, the first name of the communication object is identified according to the name corpus analysis of the context information, the second name of the communication object is read from the contact name control according to the page setting information of the application program, the first name is known to be the same as the second name through comparison, the first name and the second name are subjected to deduplication processing, and then the "mom" is inserted into the call position of each reply content, and the candidate reply information "Heymom", "Hi mom", and "Hello mom" are generated.
It should be noted that, if the first name of the communication object cannot be identified according to the name corpus of the context information, the second name of the communication object is read according to the application setting information of the application program, and the second name is inserted into the call position of each reply content to generate one or more candidate reply information.
And 104, acquiring target reply information selected by the current user from the candidate reply information, and sending the target reply information to the communication object through the application program.
Optionally, the target reply information selected from the candidate reply information by the current user through a voice instruction, a click instruction or the like is obtained, and the target reply information is sent to the communication object through the application program, so that the user can reply conveniently without manually inputting reply content.
In summary, in the method for automatically replying information according to the embodiment of the present invention, context information of a current user and a communication object through an application program is analyzed according to a natural language processing model, one or more reply contents are automatically generated, a first name of the communication object is identified according to name corpus analysis of the context information, a second name of the communication object is read according to application setting information of the application program, whether the first name and the second name are the same is further compared, if the first name and the second name are known to be different from each other through comparison, the first name and the second name are respectively inserted into a calling position of each reply content, a plurality of candidate reply information are generated, target reply information selected from the candidate reply information by the current user is further acquired, and the target reply information is sent to the communication object through the application program. Therefore, by utilizing the contact data and the context semantic information, the call information of the communication object is acquired and added into the quick reply sentence, so that the call in the quick reply is more in line with the user expectation, the accuracy of the quick reply is improved, the quick reply function is more intelligent and personalized, and the user input experience is improved.
Based on the embodiment, the name scoring model can be trained, and the candidate reply information is screened through the name scoring model, so that the candidate reply information presented to the user is more in line with the user expectation, and the accuracy and the individuation degree of quick reply are further improved.
Fig. 3 is a schematic flow chart of another method for automatically replying information according to an embodiment of the present invention, as shown in fig. 3, afterstep 103, the method further includes:
step 201, scoring the candidate reply information corresponding to the first name and the candidate reply information corresponding to the second name according to the name scoring model.
Optionally, target reply information selected by a current user in a preset time period may be acquired as training data, and parameter information of the network neural model is trained to generate a name scoring model. And then, scoring the candidate reply information through the trained name scoring model, and providing the candidate reply information with high score for the user.
As an example, the target reply information currently selected by the user within a preset time period (e.g., within a week) may be used as a positive sample, the other unselected candidate reply information may be used as a negative sample, and the positive sample and the negative sample are input into the network neural model to train the parameter information, so as to generate the name scoring model.
In this embodiment, since the name scoring model is trained in advance, after the candidate reply information corresponding to the first name and the candidate reply information corresponding to the second name are obtained, the corresponding candidate reply information is input into the name scoring model, and the scoring result of the candidate reply information can be obtained.
And step 202, deleting the candidate reply information with low score according to the scoring result, and providing the candidate reply information with high score for the user.
It is understood that a higher score of the scoring result indicates that the candidate reply message is more desirable to the user, whereas a lower score of the scoring result indicates that the candidate reply message is less desirable to the user.
In an embodiment of the present invention, each candidate reply message may be ranked from high to low according to the score of the scoring result, and then the candidate reply message ranked later is deleted, and the candidate reply message ranked earlier is selected and provided to the user. Or comparing the score of the scoring result with a preset threshold, deleting the candidate reply information with the score lower than the threshold, and selecting the candidate reply information with the score higher than the threshold as the candidate reply information provided for the user. Further, the number of candidate reply messages provided to the user may also be limited in consideration of the size of the interface space.
For a more clear explanation of the invention, the following examples are given in detail:
as shown in fig. 4, the first name is "mom", the second name is "Ellie", the corresponding candidate reply information is "Thanks mom" and "Thanks Ellie", respectively, the candidate reply information is input into the name scoring model, the score of the candidate reply information "Thanks mom" is high, the score of the candidate reply information "Thanks Ellie" is low, and then "Thanks Ellie" is deleted, and the candidate reply information "Thanks mom" is provided to the user.
According to the automatic information reply method, the parameter information of the network neural model is trained by acquiring the target reply information selected by the current user in the preset time period, the name scoring model is generated, the candidate reply information is scored according to the name scoring model, the candidate reply information with low score is deleted, and the candidate reply information with high score is provided for the user, so that the candidate reply information presented to the user is more in line with the expectation of the user, and the accuracy and the individuation degree of quick reply are further improved.
Further, in practical applications, the user may wish to use a specific nickname set by the user to call a target communication destination when communicating with the target communication destination. Fig. 5 is a flowchart illustrating another method for automatically replying to a message according to an embodiment of the present invention, as shown in fig. 5, beforestep 102, the method for automatically replying to a message includes:
step 301, judging whether the current user sets and stores a third name corresponding to the communication object in the automatic information replying function, wherein the priority of the third name is higher than that of the first name and the second name.
The third name is set by the user, so that the user always calls the target communication object by using a specific nickname set by the user when using the automatic information reply function, and the user experience is improved.
In an embodiment of the present invention, a mapping table storing a mapping relationship between the communication object and the third name may be set, and the mapping relationship between the communication object and the third name may be determined by querying the mapping table during application. For example, when the user communicates with the communication destination, if the correspondence between the communication destination and the third name can be found, it is determined that the third name corresponding to the communication destination is set by the user, and the third name is acquired.
Step 302, if it is known that the current user sets a third name in the automatic information reply function, inserting the third name into the call position of each reply content to generate one or more candidate reply information.
It should be noted that, because the priority of the third name is higher than the first name and the second name, when it is determined and obtained that the third name is set in the automatic information reply function by the current user, the first name and the second name are not obtained, but the third name is directly inserted into the call position of each reply content to generate candidate reply information, so as to obtain target reply information selected by the current user from the candidate reply information, and the target reply information is sent to the communication object through the application program. Therefore, the processing efficiency is improved, and the user can set the call information of the communication object in the quick reply content.
In an embodiment of the present invention, if it is known that the current user does not set the third name in the automatic message reply function, the first name of the communication object is identified according to the name corpus analysis of the context information.
According to the automatic information replying method, one or more candidate replying information is generated by judging whether a third name corresponding to a communication object is set in an automatic information replying function by a current user and storing the third name, and inserting the third name into the calling position of each replying content when the third name is set in the automatic information replying function by the current user is judged and known; and when judging that the current user does not set the third name in the automatic information reply function, analyzing and identifying the first name of the communication object according to the name corpus of the context information. Therefore, the user can set the call information of the communication object in the quick reply content by himself, so that the call in the quick reply is more in line with the user expectation, the individuation degree of the quick reply is further improved, and the user experience is improved.
In order to implement the foregoing embodiment, the present invention further provides an automatic information replying device, and fig. 6 is a schematic structural diagram of the automatic information replying device according to the embodiment of the present invention, as shown in fig. 6, the automatic information replying device includes: the system comprises afirst generation module 100, anacquisition module 200, aprocessing module 300, asecond generation module 400 and a sendingmodule 500.
Thefirst generation module 100 is configured to analyze context information of a current user and a communication object through an application program according to a natural language processing model, and automatically generate one or more reply contents;
an obtainingmodule 200, configured to analyze and identify a first name of a communication object according to a name corpus of context information, and read a second name of the communication object according to application setting information of an application program;
aprocessing module 300 for comparing whether the first name and the second name are the same;
asecond generating module 400, configured to insert the first name and the second name into the call location of each reply content, if it is known that the first name and the second name are different, and generate multiple candidate reply messages;
and a sendingmodule 500, configured to obtain target reply information selected by the current user from the candidate reply information, and send the target reply information to the communication object through the application program.
On the basis of fig. 6, the automatic information replying device provided in fig. 7 further includes: athird generation module 600, ascreening module 700, and afourth generation module 800.
Thethird generating module 600 is configured to obtain parameter information of a target reply information training network neural model selected by the current user within a preset time period, and generate a name scoring model.
Ascreening module 700 for
Scoring the candidate reply information corresponding to the first name and the candidate reply information corresponding to the second name according to a name scoring model;
and deleting the candidate reply information with low score according to the scoring result, and providing the candidate reply information with high score for the user.
Afourth generating module 800 for
Judging whether a third name corresponding to the communication object is set and stored in the automatic information replying function of the current user, wherein the priority of the third name is higher than that of the first name and the second name;
if the fact that the third name is not set in the automatic information reply function of the current user is known, the first name of the communication object is analyzed and identified according to the name corpus of the context information;
and if the third name is set in the automatic information reply function by the current user, inserting the third name into the call position of each reply content to generate one or more candidate reply information.
Further, the obtainingmodule 200 is specifically configured to read the second name of the communication object from the contact name control according to the application page setting information of the application program.
Further, the obtainingmodule 200 is specifically configured to read the second name of the communication object from the registered name control according to the application registration setting information of the application program.
It should be noted that the explanation of the automatic information replying method in the foregoing embodiment is also applicable to the automatic information replying device in this embodiment, and is not repeated here.
To sum up, the automatic information replying device according to the embodiment of the present invention analyzes context information of a current user and a communication object through an application program according to a natural language processing model, automatically generates one or more reply contents, further analyzes and identifies a first name of the communication object according to name corpus of the context information, reads a second name of the communication object according to application setting information of the application program, further compares whether the first name and the second name are the same, if the first name and the second name are known to be different from each other through comparison, inserts the first name and the second name into a call position of each reply content, respectively, generates a plurality of candidate reply information, further obtains target reply information selected by the current user from the candidate reply information, and sends the target reply information to the communication object through the application program. Therefore, by utilizing the contact data and the context semantic information, the call information of the communication object is acquired and added into the quick reply sentence, so that the call in the quick reply is more in line with the user expectation, the accuracy of the quick reply is improved, and the quick reply function is more intelligent and personalized.
In order to implement the foregoing embodiment, the present invention further provides a terminal device, and fig. 8 is a schematic structural diagram of the terminal device provided in the embodiment of the present invention. As shown in fig. 8, the terminal device includes: amemory 21, aprocessor 22 and a computer program stored on thememory 21 and executable on theprocessor 22.
When theprocessor 22 executes the program, the method for automatically replying information provided in the above embodiments is implemented, and the method for automatically replying information includes:
step 101', analyzing context information of a current user and a communication object through an application program according to a natural language processing model, and automatically generating one or more reply contents.
Step 102', a first name of the communication object is identified according to the name corpus analysis of the context information, and a second name of the communication object is read according to the application setting information of the application program.
And 103', comparing whether the first name is the same as the second name, if the first name is different from the second name, respectively inserting the first name and the second name into the calling position of each reply content, and generating a plurality of candidate reply messages.
And step 104', acquiring the target reply information selected by the current user from the candidate reply information, and sending the target reply information to the communication object through the application program.
Further, the terminal device further includes:
acommunication interface 23 for communication between thememory 21 and theprocessor 22.
Amemory 21 for storing a computer program operable on theprocessor 22.
Thememory 21 may comprise a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
And theprocessor 22 is configured to implement the automatic information replying method according to the foregoing embodiment when executing the program.
If thememory 21, theprocessor 22 and thecommunication interface 23 are implemented independently, thecommunication interface 21, thememory 21 and theprocessor 22 may be connected to each other through a bus and perform communication with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
Optionally, in a specific implementation, if thememory 21, theprocessor 22 and thecommunication interface 23 are integrated on a chip, thememory 21, theprocessor 22 and thecommunication interface 23 may complete mutual communication through an internal interface.
Theprocessor 22 may be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention.
In order to implement the foregoing embodiments, the present invention further provides a computer program product, which when executed by an instruction processor in the computer program product implements the method for automatically replying to information according to any of the foregoing embodiments.
In order to implement the foregoing embodiments, the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the method for automatically replying to information according to any one of the foregoing embodiments.
In the description of the present invention, it is to be understood that the terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.