CN108932066B - Method, device, equipment and computer storage medium for acquiring expression package by input method - Google Patents

Method, device, equipment and computer storage medium for acquiring expression package by input method Download PDF

Info

Publication number
CN108932066B
CN108932066B CN201810606760.5A CN201810606760A CN108932066B CN 108932066 B CN108932066 B CN 108932066B CN 201810606760 A CN201810606760 A CN 201810606760A CN 108932066 B CN108932066 B CN 108932066B
Authority
CN
China
Prior art keywords
content
interface
keyword
input
set area
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.)
Active
Application number
CN201810606760.5A
Other languages
Chinese (zh)
Other versions
CN108932066A (en
Inventor
赵涛涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201810606760.5A priority Critical patent/CN108932066B/en
Publication of CN108932066A publication Critical patent/CN108932066A/en
Application granted granted Critical
Publication of CN108932066B publication Critical patent/CN108932066B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods
    • G06F3/0237Character input methods using prediction or retrieval techniques

Abstract

The invention provides a method, a device, equipment and a computer storage medium for acquiring an expression package by an input method, wherein the method comprises the following steps: acquiring input content of a user through an input method screen and/or content of a set area on an interface; analyzing the acquired content by utilizing a keyword analysis model to obtain a first keyword corresponding to the input content and/or a second keyword corresponding to the content of a set area on the interface; carrying out expression package retrieval based on the first keyword and/or the second keyword obtained by analysis; and packaging the searched expression on an input method panel for display. By using the technical scheme provided by the invention, the expression package retrieval is performed by analyzing the content input by the user and/or the content of the set area in the interface to obtain the richer and more accurate expression package, so that the input efficiency of the user is improved.

Description

Method, device, equipment and computer storage medium for acquiring expression package by input method
[ field of technology ]
The present invention relates to the field of input methods, and in particular, to a method, an apparatus, a device, and a computer storage medium for obtaining an expression package by using an input method.
[ background Art ]
Users increasingly use various expression packages while chatting with others. In general, when a user replies by using an expression package, the user needs to reply after searching for a corresponding expression package from a custom expression package of an input method or from a network. Therefore, the existing way of recovering expression packages has the following disadvantages: the number of custom expression packages in the input method is small, and users often cannot find expression packages corresponding to the meaning of the user to be expressed; because the expression packages are too few, repeated expression packages are sent after a period of chat, and new ideas are absent; when the expression package is searched by using the search engine, the expression package needs to be switched out from the chat application tool, and a certain time is also needed for searching and importing the expression package, so that the chat efficiency of the user is reduced. Therefore, it is desirable to provide a method for obtaining expression packages by using an input method capable of improving chat efficiency of users.
[ invention ]
In view of the above, the present invention provides a method, apparatus, device and computer storage medium for obtaining expression packages by using an input method, which can provide a user with a richer and more accurate expression package and improve the input efficiency of chat of the user.
The invention provides a method for acquiring an expression package by an input method, which aims at solving the technical problems and comprises the following steps: acquiring input content of a user through an input method screen and/or content of a set area on an interface; analyzing the acquired content by utilizing a keyword analysis model to obtain a first keyword corresponding to the input content and/or a second keyword corresponding to the content of a set area on the interface; carrying out expression package retrieval based on the first keyword and/or the second keyword obtained by analysis; and packaging the searched expression on an input method panel for display.
According to a preferred embodiment of the present invention, before acquiring input content of a user through an input method screen and/or content of a set area on an interface, the method includes: and determining whether the function of the input method for acquiring the expression package is started, and if so, continuing to execute the step of acquiring the input content of the user through the screen on the input method and/or the content of the set area on the interface.
According to a preferred embodiment of the invention, the interface comprises: an instant messaging application interface or a short message interface; the acquiring of the content of the set area on the interface comprises the following steps: monitoring the interface by taking the lower boundary of the interface as a datum line; and acquiring input content at the position closest to the datum line.
According to a preferred embodiment of the present invention, when the keyword parsing model is used to parse the content of the set area on the interface, the method further includes: determining whether the content of the set area on the interface is text, if so, directly analyzing by using a keyword analysis model to obtain keywords corresponding to the content of the set area on the interface; if not, after analyzing the content of the set area on the interface into characters, obtaining keywords corresponding to the content of the set area on the interface by using a keyword analysis model.
According to a preferred embodiment of the present invention, the keyword parsing model is pre-trained by the following method: acquiring text content marked with keywords as a training sample; and taking each text content in the training sample as input, taking keywords marked by each text content as output, and training a classification model to obtain the keyword analysis model.
According to a preferred embodiment of the present invention, the performing the expression package search based on the second keyword obtained by parsing includes: obtaining a reply text corresponding to the second keyword by using a chat model; acquiring a third keyword corresponding to the reply text; and carrying out expression package retrieval based on the third keyword.
According to a preferred embodiment of the present invention, the chat model is pre-trained by: acquiring a dialogue pair comprising a first sentence and a second sentence; extracting keywords corresponding to the first sentences in each dialogue pair, and taking the second sentences in each dialogue pair as reply texts corresponding to the extracted keywords; and aggregating the reply texts corresponding to the same keywords by taking the keywords as labels, and taking the keywords and the reply texts corresponding to the keywords as the chat model.
According to a preferred embodiment of the present invention, the displaying the retrieved expression package on the input method panel includes: sequencing the expression packages obtained by searching according to a preset rule; and displaying the sequenced expression packages on an input method panel.
According to a preferred embodiment of the invention, the method further comprises: when the triggering operation of the expression package in the input method panel is detected, the expression package is displayed on the screen.
The invention provides a device for acquiring expression packages by an input method, which aims to solve the technical problems, and comprises the following components: the acquisition unit is used for acquiring input contents of a user on a screen through an input method and/or contents of a set area on an interface; the analysis unit is used for analyzing the acquired content by utilizing a keyword analysis model to obtain a first keyword corresponding to the input content and/or a second keyword corresponding to the content of the set area on the interface; the retrieval unit is used for carrying out expression package retrieval based on the first keyword and/or the second keyword obtained through analysis; and the display unit is used for displaying the searched expression on the input method panel.
According to a preferred embodiment of the present invention, before acquiring the input content of the user through the input method screen and/or the content of the set area on the interface, the acquiring unit further performs: and determining whether the function of the input method for acquiring the expression package is started, if so, continuing to execute the operation of acquiring the input content of the user through the screen on the input method and/or the content of the set area on the interface.
According to a preferred embodiment of the invention, the interface comprises: an instant messaging application interface or a short message interface; the acquiring unit, when acquiring the content of the setting area on the interface, specifically performs: monitoring the interface by taking the lower boundary of the interface as a datum line; and acquiring input content at the position closest to the datum line.
According to a preferred embodiment of the present invention, when the parsing unit parses the content of the set area on the interface using the keyword parsing model, the parsing unit further performs: determining whether the content of the set area on the interface is text, if so, directly analyzing by using a keyword analysis model to obtain keywords corresponding to the content of the set area on the interface; if not, after analyzing the content of the set area on the interface into characters, obtaining keywords corresponding to the content of the set area on the interface by using a keyword analysis model.
According to a preferred embodiment of the present invention, the apparatus further includes a first training unit, configured to pre-train to obtain a keyword parsing model by: acquiring text content marked with keywords as a training sample; and taking each text content in the training sample as input, taking keywords marked by each text content as output, and training a classification model to obtain the keyword analysis model.
According to a preferred embodiment of the present invention, the retrieving unit specifically performs, when performing the expression package retrieval based on the second keyword obtained by parsing: obtaining a reply text corresponding to the second keyword by using a chat model; acquiring a third keyword corresponding to the reply text; and carrying out expression package retrieval based on the third keyword.
According to a preferred embodiment of the present invention, the apparatus further comprises a second training unit, configured to pre-train to obtain a chat model in the following manner: acquiring a dialogue pair comprising a first sentence and a second sentence; extracting keywords corresponding to the first sentences in each dialogue pair, and taking the second sentences in each dialogue pair as reply texts corresponding to the extracted keywords; and aggregating the reply texts corresponding to the same keywords by taking the keywords as labels, and taking the keywords and the reply texts corresponding to the keywords as the chat model.
According to a preferred embodiment of the present invention, the display unit specifically performs, when displaying the retrieved expression package on the input method panel: sequencing the expression packages obtained by searching according to a preset rule; and displaying the sequenced expression packages on an input method panel.
According to a preferred embodiment of the invention, the display unit is further adapted to perform: when the triggering operation of the expression package in the input method panel is detected, the expression package is displayed on the screen.
According to the technical scheme, the expression package retrieval is carried out through the keywords obtained by analyzing the content input by the user and/or the content of the set area in the interface, so that richer and more accurate expression packages can be obtained, and the input efficiency of the user is improved.
[ description of the drawings ]
FIG. 1 is a flowchart of a method for obtaining an expression package by an input method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an instant messaging interface according to an embodiment of the present invention;
FIG. 3 is a schematic diagram showing an expression package obtained by searching according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a device for obtaining an expression package according to an input method according to an embodiment of the present invention;
FIG. 5 is a block diagram of a computer system/server according to an embodiment of the present invention.
[ detailed description ] of the invention
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely one relationship describing the association of the associated objects, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
Depending on the context, the word "if" as used herein may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to detection". Similarly, the phrase "if determined" or "if detected (stated condition or event)" may be interpreted as "when determined" or "in response to determination" or "when detected (stated condition or event)" or "in response to detection (stated condition or event), depending on the context.
Fig. 1 is a flowchart of a method for obtaining an expression package by using an input method according to an embodiment of the present invention, where, as shown in fig. 1, the method includes:
in 101, input content of a user through an input method screen and/or content of a set area on an interface are obtained.
In this step, at least one of the input content of the user through the input method screen and the content of the setting area on the interface is acquired. The input content of the user on the screen through the input method can be only acquired, for example, the content input by the user in the input box of the input method is acquired. The content of the setting area on the interface may be obtained only, where the interface may include an instant messaging application interface or a short message interface. For example, when the content of the setting area on the interface is acquired, the chat content of the counterpart user in the instant messaging interface may be acquired, and the chat content of the current user even in the communication interface may be acquired. And the content of the set area on the interface can be acquired simultaneously with the input content of the user on the screen through the input method. For example, the content input by the user in the input box of the input method and the chat content of the opposite user in the instant messaging interface are obtained. In this embodiment, it is preferable to acquire the input content of the user through the screen on the input method and the content of the set area on the interface at the same time.
Since the current user may want to reply with the expression package when replying with other users, it may also want to reply with text. Thus, before this step, it may further include: determining whether an expression package acquisition function of the input method is started, if so, indicating that a user wants to reply by using the expression package, and continuously executing the step of acquiring the input content of the user through the screen of the input method and/or the content of a set area on the interface; otherwise, the user is indicated to reply by using the text or searching the expression package by himself, and the step of acquiring the input content of the user through the screen of the input method and/or the content of the set area on the interface is not needed to be continuously executed.
Specifically, the content of the set area on the interface may be acquired in the following manner: monitoring the interface by taking the lower boundary of the interface as a datum line; and acquiring input content at the position closest to the datum line as the content of the set area on the interface. The content of the set area on the interface may also be acquired in the following manner: acquiring display time of each piece of input content in an interface; and taking the current time as the reference time, acquiring the input content with the display time closest to the reference time as the content of the set area on the interface. It can be understood that the content of the setting area on the interface may be the input content sent by the current user on the interface, or may be the input content sent by the opposite user on the interface. In this embodiment, the content of the setting area on the interface is preferably the input content sent by the counterpart user on the interface.
In 102, the obtained content is parsed by using a keyword parsing model, so as to obtain a first keyword corresponding to the input content and/or a second keyword corresponding to the content of the set area on the interface.
In this step, the content acquired in step 101 is parsed by a keyword parsing model to obtain keywords corresponding to the acquired content. In this embodiment, it is preferable to obtain the first keyword corresponding to the input content and the second keyword corresponding to the content of the set area on the interface at the same time.
The keyword analysis model can be obtained by training in advance in the following manner: acquiring text content marked with keywords as a training sample; and taking each text content in the training sample as input, taking keywords marked by each text content as output, and training the classification model to obtain a keyword analysis model. And obtaining keywords corresponding to the text content by utilizing the keyword analysis model obtained through training.
In this step, the content of the set area on the interface may be text content or non-text content such as expression pack and symbol. If the text content is the text content, the keyword analysis model can be directly utilized to obtain the keyword corresponding to the content of the set area on the interface; if the text is non-text, the text corresponding to the non-text can be obtained by analyzing the non-text, for example, analyzing the expression package or the image, and then analyzing the obtained text by using a keyword analysis model to obtain keywords corresponding to the content of the set area on the interface.
In 103, the expression package search is performed based on the first keyword and/or the second keyword obtained by parsing.
In this step, the keyword obtained by the parsing in step 102 is used to search the expression package. It can be understood that when the expression package search is performed based on the keywords, the search can be performed in the input method local database, and the expression package search can also be performed through a search engine. In this embodiment, the expression package search is preferably performed based on the first keyword and the second keyword at the same time.
When the expression package is searched based on the first keyword, the first keyword can be used for representing semantic information of the current user to answer the opposite user, so that the first keyword can be directly used for searching the expression package.
When the expression package search is performed based on the second keyword, if the content of the set area on the interface is the input content of the current user, the second keyword can be directly utilized to perform the expression package search. If the content of the set area on the interface is the input content of the opposite user, the second keyword represents semantic information of the input content of the opposite user. Therefore, this step can employ the following manner in performing the expression package search based on the second keyword corresponding to the input content of the counterpart user: obtaining a reply text corresponding to the second keyword by using the chat model; obtaining keywords corresponding to the obtained reply text as third keywords; and carrying out expression package retrieval based on the obtained third keyword. That is, the third keyword generated based on the chat content of the counterpart user is used to represent semantic information that the current user wants to answer to the counterpart user.
The chat model may be pre-established in the following manner: acquiring a dialogue pair; extracting keywords corresponding to the question sentences in each dialogue pair, and taking the answer sentences in each dialogue pair as answer texts corresponding to the extracted keywords; and aggregating the reply texts corresponding to the same keywords by taking the keywords as labels, and taking the keywords and the reply texts corresponding to the keywords as a chat model. And generating corresponding reply text according to the keywords by using the established chat model.
For example, if the acquired dialogue pairs are respectively "question: hello comma, answer: you are also "," ask: you do this comma, answer: entertainment "," ask: too playful, answer: not to play together, etc. The keywords of "you get a comma" and "you get a comma" are "comma", "too fun" are "fun", and the reply text corresponding to the keyword "comma" is "you are also" and "fun", and the reply text corresponding to the keyword "fun" is "do not want to play together".
In addition, it can be understood that when the reply text is obtained according to the keyword, there may be a case that a plurality of reply texts correspond to the same keyword, and then a mode of randomly selecting at least one from the plurality of reply texts may be adopted to obtain the keyword corresponding to the randomly selected reply text, and then performing expression package search.
At 104, the retrieved expression is displayed on the input method panel.
In this step, the expression retrieved in step 103 is displayed on the input method panel.
Before displaying the expression package, the method may further include: and sequencing the expression packages obtained by searching according to a preset rule, and displaying the expression packages on an input method panel according to a sequencing result. The expression packages obtained by retrieval can be ordered directly according to the actual click frequency of each expression package, the definition of the expression package and the like. In addition, if the input content of the user through the input method screen and the content of the set area on the interface are acquired at the same time, when the expression package is displayed on the input method panel, preferably, the expression package obtained by searching the input content of the user through the input method screen may be displayed first, and then the expression package obtained by searching the content of the set area on the interface may be displayed.
When the expression pack is displayed on the input method panel, the expression pack can be directly displayed in a preset area in the input method panel, for example, above or below the input content of the user; the expression package can be displayed in the input method panel when the user clicks the expression package control of the input method, for example, when clicking the expression button of the input method.
In addition, after the expression package is displayed on the input method panel, the method may further include: and if the expression package triggering operation displayed in the input method panel is detected, the expression package triggered by the screen is displayed, namely, the user performs screen display on the expression package selected in the input method panel. Because the display interface is limited, the user can select more expression packages on the input method panel in a sliding and clicking mode.
The above procedure will be described below by taking instant messaging application as an example:
as shown in fig. 2, if the input content of the user through the input method screen is "kneeling, the content of the set area on the chat interface is" not wanted "as the last reply content of the opposite user. The keyword analysis model is utilized to analyze the "kneeling request" and the "unwanted" to obtain, for example, the keyword corresponding to the "kneeling request" is "kneeling request", and the keyword corresponding to the "unwanted" is "unwanted". When carrying out expression package retrieval, the expression package retrieval can be directly carried out by taking kneeling and asking as a keyword; for the keyword "unwanted" the reply text corresponding to "unwanted" may be generated first, for example, the generated reply text may be at least one of "me is very wounded" and "me is wanted to beat", then the keyword corresponding to "me is obtained as" wounded ", the keyword corresponding to" me is obtained as "beat", and the expression package search is performed with the keyword "wounded" and "beat" as keywords. After the expression package search is performed by using the keywords, the expression packages obtained by the search are displayed, as shown in fig. 3, the expression packages corresponding to the keywords "kneel and ask" can be displayed first, the expression packages corresponding to the keywords "hurt the heart" can be displayed later, and the expression packages corresponding to the "get people" can be displayed later according to the sequence from left to right.
Fig. 4 is a block diagram of an apparatus for obtaining an expression package according to an input method provided by an embodiment of the present invention, as shown in fig. 4, where the apparatus includes: acquisition unit 41, first training unit 42, parsing unit 43, second training unit 44, retrieving unit 45, and presentation unit 46.
And an acquisition unit 41, configured to acquire input content of a user on a screen through an input method and/or content of a set area on an interface.
The acquisition unit 41 acquires at least one of the input content of the user on the screen through the input method and the content of the set area on the interface. Here, the acquiring unit 41 may acquire only the input content of the user on the screen through the input method, for example, acquire the content input by the user in the input box of the input method. The obtaining unit 41 may also obtain only the content of the setting area on the interface, where the interface may include an instant messaging application interface or a short message interface. For example, when the content of the setting area on the interface is acquired, the chat content of the counterpart user in the instant messaging interface may be acquired, and the chat content of the current user even in the communication interface may be acquired. The acquisition unit 41 may also acquire the input content of the user through the input method screen and the content of the setting area on the interface at the same time. For example, the content input by the user in the input box of the input method and the chat content of the opposite user in the instant messaging interface are obtained. In the present embodiment, the acquisition unit 41 preferably acquires the input content of the user through the input method screen and the content of the setting area on the interface at the same time.
Since the current user may want to reply with the expression package when replying with other users, it may also want to reply with text. The acquisition unit 41 may thus further perform, before acquiring the content: determining whether an expression package acquisition function of the input method is started, if so, indicating that a user wants to reply by using the expression package, and continuously executing the operation of acquiring the input content of the user through the screen of the input method and/or the content of a set area on the interface; otherwise, the user is indicated to reply by using the text or searching the expression package by himself, and the operation of obtaining the input content of the user through the screen of the input method and/or the content of the set area on the interface is not needed to be continuously executed.
Specifically, the acquisition unit 41 may acquire the contents of the set area on the interface in the following manner: monitoring the interface by taking the lower boundary of the interface as a datum line; and acquiring input content at the position closest to the datum line as the content of the set area on the interface. The acquisition unit 41 may also acquire the contents of the set area on the interface in the following manner: monitoring an interface, and acquiring display time of each piece of input content in the interface; and taking the current time as the reference time, acquiring the input content with the display time closest to the reference time as the content of the set area on the interface. It can be understood that the content of the setting area on the interface may be the input content sent by the current user on the interface, or may be the input content sent by the opposite user on the interface. In this embodiment, the content of the setting area on the interface is preferably the input content sent by the counterpart user on the interface.
The first training unit 42 is configured to train in advance to obtain a keyword parsing model.
The first training unit 42 may perform training in advance to obtain a keyword resolution model in the following manner: acquiring text content marked with keywords as a training sample; and taking each text content in the training sample as input, taking keywords marked by each text content as output, and training the classification model to obtain a keyword analysis model. The keyword analysis model obtained by training by the first training unit 42 can be used to obtain keywords corresponding to text contents.
The parsing unit 43 is configured to parse the obtained content by using a keyword parsing model, so as to obtain a first keyword corresponding to the input content and/or a second keyword corresponding to the content of the set area on the interface.
The parsing unit 43 parses the content acquired by the acquisition unit 41 using a keyword parsing model to obtain keywords corresponding to the acquired content. In the present embodiment, the parsing unit 43 preferably obtains the first keyword corresponding to the input content and the second keyword corresponding to the content of the set area on the interface at the same time.
The content of the set area on the interface can be text content or non-text content such as expression package, symbol and the like. If the content is text, the parsing unit 43 may directly use the keyword parsing model to obtain keywords corresponding to the content of the set area on the interface; if the text content is non-text content, the parsing unit 43 may parse the non-text content, for example, perform image parsing on the expression package or the image, to obtain text corresponding to the non-text content, and then parse the obtained text by using the keyword parsing model, to obtain keywords corresponding to the content of the set area on the interface.
A second training unit 44, configured to perform training in advance to obtain a chat model.
The second training unit 44 may pre-build the chat model in the following manner: acquiring a dialogue pair; extracting keywords corresponding to the question sentences in each dialogue pair, and taking the answer sentences in each dialogue pair as answer texts corresponding to the extracted keywords; and aggregating the reply texts corresponding to the same keywords by taking the keywords as labels, and taking the keywords and the reply texts corresponding to the keywords as a chat model. The corresponding reply text can be generated from the keywords using the chat model established by the second training unit 44.
The retrieving unit 45 is configured to perform expression package retrieval based on the parsed first keyword and/or second keyword.
The search unit 45 searches the expression package using the keyword analyzed by the analysis unit 43. It can be understood that, when performing the expression package search based on the keywords, the search unit 45 may perform the search in the input method local database, or may perform the expression package search through a search engine. In the present embodiment, the retrieval unit 45 preferably performs the expression package retrieval based on the first keyword and the second keyword at the same time.
When the search unit 45 performs the expression package search based on the first keyword, the search unit 45 may perform the expression package search directly using the first keyword, because the first keyword can represent semantic information of the current user to be replied to the counterpart user.
When the retrieving unit 45 retrieves the expression package based on the second keyword, if the content of the set area on the interface is the input content of the current user, the retrieving unit 45 may directly retrieve the expression package using the second keyword. If the content of the set area on the interface is the input content of the opposite user, the second keyword represents semantic information of the input content of the opposite user. Therefore, the retrieval unit 45 may employ the following manner in performing the expression package retrieval based on the second keyword corresponding to the input content of the counterpart user: generating a reply text corresponding to the second keyword by utilizing the chat model obtained by the pre-training of the second training unit; obtaining keywords corresponding to the generated reply text as third keywords; the retrieval unit 45 performs expression package retrieval based on the obtained third keyword. That is, the third keyword generated based on the chat content of the counterpart user is used to represent semantic information that the current user wants to answer to the counterpart user.
In addition, it may be understood that when the reply text is obtained according to the keyword, there may be a case that a plurality of reply texts correspond to the same keyword, and the retrieving unit 45 may perform the expression package retrieval after obtaining the keyword corresponding to the randomly selected reply text by adopting a manner of randomly selecting at least one from the plurality of reply texts.
The display unit 46 displays the expression packet obtained by the search on the input method panel.
The display unit 46 displays the expression retrieved by the retrieving unit 45 on the input method panel. Before the expression packages are displayed, the display unit 46 may further sort the retrieved expression packages according to a preset rule, and further display the expression packages on the input method panel according to the sorting result. The display unit 46 may sort the expression packages obtained by searching directly according to the actual click frequency of each expression package, the definition of the expression package, and the like. In addition, if the user inputs the content through the input method screen and the content of the setting area on the interface are simultaneously acquired, the display unit 46 may preferably display the expression package retrieved according to the user inputs the content through the input method screen, and then display the expression package retrieved according to the content of the setting area on the interface.
When the expression pack is displayed on the input method panel, the display unit 46 may directly display the expression pack in a preset area in the input method panel, for example, above or below the user input content; the display unit 46 may further display the expression pack in the input method panel when the user clicks the expression pack control of the input method, for example, when clicking the expression button of the input method.
The display unit 46 may further perform, after displaying the expression pack on the input method panel: if the expression package triggering operation displayed in the input method panel is detected, the expression package triggered by the screen-up, that is, the display unit 46 performs screen-up on the expression package selected by the user in the input method panel. It can be understood that, due to the limited display interface, the user can select more expression packages on the input method panel in a sliding and clicking manner.
As shown in fig. 5, the computer system/server 012 is in the form of a general purpose computing device. Components of computer system/server 012 may include, but are not limited to: one or more processors or processing units 016, a system memory 028, a bus 018 connecting the various system components, including the system memory 028 and the processing unit 016.
Bus 018 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics accelerator port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer system/server 012 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer system/server 012 and includes both volatile and non-volatile media, removable and non-removable media.
The system memory 028 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 030 and/or cache memory 032. The computer system/server 012 can further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 034 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, commonly referred to as a "hard disk drive"). Although not shown in fig. 5, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 018 by one or more data media interfaces. Memory 028 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 040 having a set (at least one) of program modules 042 can be stored, for example, in memory 028, such program modules 042 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 042 generally carry out the functions and/or methodologies of the embodiments described herein.
The computer system/server 012 may also communicate with one or more external devices 014 (e.g., keyboard, pointing device, display 024, etc.), in the present invention, the computer system/server 012 communicates with an external radar device, one or more devices that enable a user to interact with the computer system/server 012, and/or any device (e.g., network card, modem, etc.) that enables the computer system/server 012 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 022. Also, the computer system/server 012 can communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet via a network adapter 020. As shown, the network adapter 020 communicates with other modules of the computer system/server 012 via bus 018. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with computer system/server 012, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 016 executes various functional applications and data processing by running a program stored in the system memory 028, for example, a method for implementing an input method to acquire an expression package may include:
acquiring input content of a user through an input method screen and/or content of a set area on an interface;
analyzing the acquired content by utilizing a keyword analysis model to obtain a first keyword corresponding to the input content and/or a second keyword corresponding to the content of a set area on the interface;
carrying out expression package retrieval based on the first keyword and/or the second keyword obtained by analysis;
and packaging the searched expression on an input method panel for display.
The computer program described above may be provided in a computer storage medium, i.e. the computer storage medium is encoded with a computer program which, when executed by one or more computers, causes the one or more computers to perform the method flows and/or apparatus operations shown in the above-described embodiments of the invention. For example, a method flow performed by the one or more processors described above may include:
acquiring input content of a user through an input method screen and/or content of a set area on an interface;
Analyzing the acquired content by utilizing a keyword analysis model to obtain a first keyword corresponding to the input content and/or a second keyword corresponding to the content of a set area on the interface;
carrying out expression package retrieval based on the first keyword and/or the second keyword obtained by analysis;
and packaging the searched expression on an input method panel for display.
With the development of time and technology, the media has a wider meaning, and the propagation path of the computer program is not limited to a tangible medium any more, and can be directly downloaded from a network, etc. Any combination of one or more computer readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
By utilizing the technical scheme provided by the invention, the expression package retrieval is carried out by analyzing the content input by the user and the keyword obtained by analyzing the content of the set area in the interface, so that the richer and more accurate expression package can be obtained, and the input efficiency of the user is improved.
In the several embodiments provided in the present invention, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is merely a logical function division, and there may be other manners of division when actually implemented.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform part of the steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather to enable any modification, equivalent replacement, improvement or the like to be made within the spirit and principles of the invention.

Claims (18)

1. A method for obtaining expression packages by an input method, the method comprising:
acquiring input content of a current user through an input method screen and content of a set area on an interface, wherein the content of the set area on the interface is the input content sent by the current user on the interface and/or the input content sent by a counterpart user on the interface;
Analyzing the acquired content by utilizing a keyword analysis model to obtain a first keyword corresponding to the input content and a second keyword corresponding to the content of a set area on the interface;
carrying out expression package retrieval based on the first keyword and the second keyword which are obtained through analysis;
the expression obtained by searching is packaged on an input method panel for display;
when the keyword analysis model is used for analyzing the content of the set area on the interface, the method further comprises the following steps:
determining whether the content of the set area on the interface is text, if so, directly analyzing by using a keyword analysis model to obtain keywords corresponding to the content of the set area on the interface;
if not, after analyzing the content of the set area on the interface into characters, obtaining keywords corresponding to the content of the set area on the interface by using a keyword analysis model.
2. The method according to claim 1, wherein before acquiring the input content of the current user through the input method screen and the content of the set area on the interface, the method comprises:
and determining whether the function of the input method for acquiring the expression package is started, and if so, continuing to execute the step of acquiring the input content of the current user through the screen of the input method and the content of the set area on the interface.
3. The method of claim 1, wherein the interface comprises: an instant messaging application interface or a short message interface;
the acquiring of the content of the set area on the interface comprises the following steps:
monitoring the interface by taking the lower boundary of the interface as a datum line;
and acquiring input content at the position closest to the datum line.
4. The method of claim 1, wherein the keyword resolution model is pre-trained by:
acquiring text content marked with keywords as a training sample;
and taking each text content in the training sample as input, taking keywords marked by each text content as output, and training a classification model to obtain the keyword analysis model.
5. The method of claim 1, wherein the performing the expression package search based on the parsed second keyword comprises:
obtaining a reply text corresponding to the second keyword by using a chat model;
acquiring a third keyword corresponding to the reply text;
and carrying out expression package retrieval based on the third keyword.
6. The method of claim 5, wherein the chat model is pre-trained by:
Acquiring a dialogue pair comprising a first sentence and a second sentence;
extracting keywords corresponding to the first sentences in each dialogue pair, and taking the second sentences in each dialogue pair as reply texts corresponding to the extracted keywords;
and aggregating the reply texts corresponding to the same keywords by taking the keywords as labels, and taking the keywords and the reply texts corresponding to the keywords as the chat model.
7. The method of claim 1, wherein displaying the retrieved expression package on the input method panel comprises:
sequencing the expression packages obtained by searching according to a preset rule;
and displaying the sequenced expression packages on an input method panel.
8. The method according to claim 1, wherein the method further comprises:
when the triggering operation of the expression package in the input method panel is detected, the expression package is displayed on the screen.
9. An apparatus for obtaining expression packages by using an input method, the apparatus comprising:
the device comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for acquiring the input content of a current user on a screen through an input method and the content of a set area on an interface, and the content of the set area on the interface is the input content sent by the current user on the interface and/or the input content sent by a counterpart user on the interface;
The analysis unit is used for analyzing the acquired content by utilizing a keyword analysis model to obtain a first keyword corresponding to the input content and a second keyword corresponding to the content of the set area on the interface;
the retrieval unit is used for carrying out expression package retrieval based on the first keyword and the second keyword which are obtained through analysis;
the display unit is used for displaying the searched expression on the input method panel;
the parsing unit further performs, when parsing the content of the set area on the interface using the keyword parsing model:
determining whether the content of the set area on the interface is text, if so, directly analyzing by using a keyword analysis model to obtain keywords corresponding to the content of the set area on the interface;
if not, after analyzing the content of the set area on the interface into characters, obtaining keywords corresponding to the content of the set area on the interface by using a keyword analysis model.
10. The apparatus according to claim 9, wherein the acquisition unit further performs, before acquiring the input content of the current user through the input method screen and the content of the set area on the interface:
And determining whether the function of the input method for acquiring the expression package is started, and if so, continuing to execute the step of acquiring the input content of the current user through the screen of the input method and the content of the set area on the interface.
11. The apparatus of claim 9, wherein the interface comprises: an instant messaging application interface or a short message interface;
the acquiring unit, when acquiring the content of the setting area on the interface, specifically performs:
monitoring the interface by taking the lower boundary of the interface as a datum line;
and acquiring input content at the position closest to the datum line.
12. The apparatus of claim 9, further comprising a first training unit configured to pre-train to obtain the keyword resolution model by:
acquiring text content marked with keywords as a training sample;
and taking each text content in the training sample as input, taking keywords marked by each text content as output, and training a classification model to obtain the keyword analysis model.
13. The apparatus according to claim 9, wherein the retrieving unit, when performing the expression package retrieval based on the parsed second keyword, specifically performs:
Obtaining a reply text corresponding to the second keyword by using a chat model;
acquiring a third keyword corresponding to the reply text;
and carrying out expression package retrieval based on the third keyword.
14. The apparatus of claim 13, further comprising a second training unit for pre-training to obtain a chat model by:
acquiring a dialogue pair comprising a first sentence and a second sentence;
extracting keywords corresponding to the first sentences in each dialogue pair, and taking the second sentences in each dialogue pair as reply texts corresponding to the extracted keywords;
and aggregating the reply texts corresponding to the same keywords by taking the keywords as labels, and taking the keywords and the reply texts corresponding to the keywords as the chat model.
15. The apparatus according to claim 9, wherein the display unit, when displaying the retrieved expression package on the input method panel, specifically performs:
sequencing the expression packages obtained by searching according to a preset rule;
and displaying the sequenced expression packages on an input method panel.
16. The apparatus of claim 9, wherein the display unit is further configured to perform:
When the triggering operation of the expression package in the input method panel is detected, the expression package is displayed on the screen.
17. An electronic device, the electronic device comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-8.
18. A storage medium containing computer executable instructions for performing the method of any of claims 1-8 when executed by a computer processor.
CN201810606760.5A 2018-06-13 2018-06-13 Method, device, equipment and computer storage medium for acquiring expression package by input method Active CN108932066B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810606760.5A CN108932066B (en) 2018-06-13 2018-06-13 Method, device, equipment and computer storage medium for acquiring expression package by input method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810606760.5A CN108932066B (en) 2018-06-13 2018-06-13 Method, device, equipment and computer storage medium for acquiring expression package by input method

Publications (2)

Publication Number Publication Date
CN108932066A CN108932066A (en) 2018-12-04
CN108932066B true CN108932066B (en) 2023-04-25

Family

ID=64446478

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810606760.5A Active CN108932066B (en) 2018-06-13 2018-06-13 Method, device, equipment and computer storage medium for acquiring expression package by input method

Country Status (1)

Country Link
CN (1) CN108932066B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109831572A (en) * 2018-12-14 2019-05-31 深圳壹账通智能科技有限公司 Chat picture control method, device, computer equipment and storage medium
CN111381685B (en) * 2018-12-29 2024-03-22 北京搜狗科技发展有限公司 Sentence association method and sentence association device
CN110336733B (en) * 2019-04-30 2022-05-17 上海连尚网络科技有限公司 Method and equipment for presenting emoticon
CN110187862A (en) * 2019-05-29 2019-08-30 北京达佳互联信息技术有限公司 Speech message display methods, device, terminal and storage medium
CN112825015A (en) * 2019-11-20 2021-05-21 阿里巴巴集团控股有限公司 Data object, expression package generation method, computer device and storage medium
CN111385188A (en) * 2019-11-22 2020-07-07 百度在线网络技术(北京)有限公司 Recommendation method and device for dialog elements, electronic equipment and medium
CN112462992B (en) * 2020-11-30 2022-07-19 北京搜狗科技发展有限公司 Information processing method and device, electronic equipment and medium
CN113112281A (en) * 2021-04-16 2021-07-13 上海岐力电子商务有限公司 Customer service training method and customer service system based on artificial intelligence

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004164589A (en) * 2002-09-24 2004-06-10 Nariyuki Motoi Content providing system
JP2013092826A (en) * 2011-10-24 2013-05-16 Yahoo Japan Corp Search query related word output device, search query related word output method and search assistance system
CN104380240A (en) * 2012-06-20 2015-02-25 三星电子株式会社 Information display apparatus and method of user device
AU2015101183A4 (en) * 2014-09-02 2015-10-08 Apple Inc. User interface for receiving user input
CN106326640A (en) * 2016-08-12 2017-01-11 上海交通大学医学院附属瑞金医院卢湾分院 Medical speech control system and control method thereof
CN108092875A (en) * 2017-11-08 2018-05-29 网易乐得科技有限公司 A kind of expression providing method, medium, device and computing device
CN108121799A (en) * 2017-12-21 2018-06-05 广东欧珀移动通信有限公司 Recommendation method, apparatus, storage medium and the mobile terminal of revert statement

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104063427A (en) * 2014-06-06 2014-09-24 北京搜狗科技发展有限公司 Expression input method and device based on semantic understanding
CN105975100B (en) * 2016-04-28 2019-07-30 百度在线网络技术(北京)有限公司 The expanding method and device of expression packet in input method
CN106021599A (en) * 2016-06-08 2016-10-12 维沃移动通信有限公司 Emotion icon recommending method and mobile terminal
CN106484664B (en) * 2016-10-21 2019-03-01 竹间智能科技(上海)有限公司 Similarity calculating method between a kind of short text
CN107038214A (en) * 2017-03-06 2017-08-11 北京小米移动软件有限公司 Expression information processing method and processing device
CN107491477B (en) * 2017-06-30 2021-02-19 百度在线网络技术(北京)有限公司 Emotion symbol searching method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004164589A (en) * 2002-09-24 2004-06-10 Nariyuki Motoi Content providing system
JP2013092826A (en) * 2011-10-24 2013-05-16 Yahoo Japan Corp Search query related word output device, search query related word output method and search assistance system
CN104380240A (en) * 2012-06-20 2015-02-25 三星电子株式会社 Information display apparatus and method of user device
AU2015101183A4 (en) * 2014-09-02 2015-10-08 Apple Inc. User interface for receiving user input
CN106326640A (en) * 2016-08-12 2017-01-11 上海交通大学医学院附属瑞金医院卢湾分院 Medical speech control system and control method thereof
CN108092875A (en) * 2017-11-08 2018-05-29 网易乐得科技有限公司 A kind of expression providing method, medium, device and computing device
CN108121799A (en) * 2017-12-21 2018-06-05 广东欧珀移动通信有限公司 Recommendation method, apparatus, storage medium and the mobile terminal of revert statement

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
Ashkan Azin 等.Classifying and characterizing query intent.《Advances in Information Retrieval: 31th European Conference on IR Research》.2009,578-586. *
Narmadha R. P. 等.A survey on online tweet segmentation for linguistic features.《2016 International Conference on Computer Communication and Informatics (ICCCI)》.2016,1-6. *
刘承运.基于上下文观点的微博情感倾向分析研究.《中国优秀硕士学位论文全文数据库信息科技辑》.2018,(第01期),I138-2062. *
周志华.聊天系统文本情感细粒度分类研究与应用.《中国优秀硕士学位论文全文数据库信息科技辑》.2017,(第02期),I138-4380. *
樊波.非智能手机输入法的设计与实现.《中国优秀硕士学位论文全文数据库信息科技辑》.2013,(第02期),I136-619. *

Also Published As

Publication number Publication date
CN108932066A (en) 2018-12-04

Similar Documents

Publication Publication Date Title
CN108932066B (en) Method, device, equipment and computer storage medium for acquiring expression package by input method
US20200401765A1 (en) Man-machine conversation method, electronic device, and computer-readable medium
US9858264B2 (en) Converting a text sentence to a series of images
CN107832433B (en) Information recommendation method, device, server and storage medium based on conversation interaction
CN109657054B (en) Abstract generation method, device, server and storage medium
US10043514B2 (en) Intelligent contextually aware digital assistants
US10733197B2 (en) Method and apparatus for providing information based on artificial intelligence
US9031832B2 (en) Context-based disambiguation of acronyms and abbreviations
CN109299320B (en) Information interaction method and device, computer equipment and storage medium
US20180089178A1 (en) Mining multi-lingual data
US20160328378A1 (en) Anaphora resolution for semantic tagging
US20140067842A1 (en) Information processing method and apparatus
KR20160026892A (en) Non-factoid question-and-answer system and method
CN109543058B (en) Method, electronic device, and computer-readable medium for detecting image
CN107909088B (en) Method, apparatus, device and computer storage medium for obtaining training samples
CN109635094B (en) Method and device for generating answer
CN109815482B (en) News interaction method, device, equipment and computer storage medium
CN110287405B (en) Emotion analysis method, emotion analysis device and storage medium
CN109815481B (en) Method, device, equipment and computer storage medium for extracting event from text
US11797594B2 (en) Systems and methods for generating labeled short text sequences
KR20190054884A (en) Method and system for providing real-time feedback information associated with user-input contents
Yang et al. Tour: Dynamic topic and sentiment analysis of user reviews for assisting app release
CN108268443B (en) Method and device for determining topic point transfer and acquiring reply text
CN108268602A (en) Analyze method, apparatus, equipment and the computer storage media of text topic point
US20220035849A1 (en) Computer-readable recording medium storing response processing program, response processing method, and information processing apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant