CN113946228A - Statement recommendation method and device, electronic equipment and readable storage medium - Google Patents

Statement recommendation method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN113946228A
CN113946228A CN202010683244.XA CN202010683244A CN113946228A CN 113946228 A CN113946228 A CN 113946228A CN 202010683244 A CN202010683244 A CN 202010683244A CN 113946228 A CN113946228 A CN 113946228A
Authority
CN
China
Prior art keywords
sentence
input
input method
candidate
environment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010683244.XA
Other languages
Chinese (zh)
Inventor
姚波怀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sogou Technology Development Co Ltd
Original Assignee
Beijing Sogou Technology Development 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 Sogou Technology Development Co Ltd filed Critical Beijing Sogou Technology Development Co Ltd
Priority to CN202010683244.XA priority Critical patent/CN113946228A/en
Publication of CN113946228A publication Critical patent/CN113946228A/en
Pending legal-status Critical Current

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Human Computer Interaction (AREA)
  • Machine Translation (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The embodiment of the invention provides a sentence recommendation method, a sentence recommendation device, electronic equipment and a readable storage medium, wherein when an input method is called up, the input environment of the input method is determined; obtaining a sentence prediction word bank of the input method; acquiring a target sentence matched with the input environment in the sentence prediction word stock as a candidate sentence; and displaying the candidate sentences. The embodiment of the invention aims at personalized statement display of the user in different input environments, thereby improving the input experience of the user.

Description

Statement recommendation method and device, electronic equipment and readable storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a sentence recommendation method, an apparatus, an electronic device, and a readable storage medium.
Background
With the development of computer technology, electronic devices such as mobile phones and tablet computers are more and more popular, and great convenience is brought to life, study and work of people. These electronic devices are typically installed with an input method application (abbreviated as input method) so that a user can input information using the input method.
When a user inputs the input method, the input method can not only predict word granularity, but also predict statement granularity, but the current statement prediction models are all general models and cannot be recommended according to personalized statements for the user.
Disclosure of Invention
The embodiment of the invention provides a sentence recommendation method, which aims to realize personalized sentence recommendation for a user in different input environments and improve the input experience of the user.
Correspondingly, the embodiment of the invention also provides a sentence recommendation device, electronic equipment and a readable storage medium, which are used for ensuring the realization and application of the method.
In order to solve the above problem, an embodiment of the present invention discloses a sentence recommendation method, which specifically includes:
when the input method is called up, determining the input environment of the input method;
obtaining a sentence prediction word bank of the input method;
acquiring a target sentence matched with the input environment in the sentence prediction word stock as a candidate sentence;
and displaying the candidate sentences.
Optionally, the input environment includes an application program that invokes the input method.
Optionally, the obtaining of the sentence prediction lexicon of the input method includes:
when the input method is logged in through a user account, a sentence prediction word bank set for the user account in the input method is obtained;
and when the input method is not logged in through a user account, acquiring a sentence prediction word bank preset in the input method.
Optionally, when the input method is invoked, before determining an input environment of the input method, the method further includes:
acquiring sentences displayed on a screen of an input method and the screen display time of the sentences;
acquiring an input environment when the sentence is displayed on the screen by the input method;
and updating the sentence, the screen-up time and the input environment into the sentence prediction word stock as a record data.
Optionally, after the sentence, the screen time and the input environment are updated into the sentence prediction lexicon as a recorded data, the method includes:
acquiring the use frequency of the sentences in the sentence prediction word stock and the last screen time;
and when the using frequency of the sentences is lower than a first preset frequency and the last screen-on time meets a preset deleting condition, deleting the recorded data corresponding to the sentences from the sentence prediction word stock.
Optionally, the obtaining a target sentence in the sentence prediction lexicon, which is matched with the input environment, as a candidate sentence includes:
determining an input state at the input method; the input state is used for representing whether the input method acquires input information or not;
and acquiring a target sentence matched with the input environment in the sentence prediction word bank as a candidate sentence according to the input state.
Optionally, the obtaining, according to the input state, a target sentence in the sentence prediction lexicon, which is matched with the input environment, as a candidate sentence includes:
and when the input information is not acquired in the input method, acquiring a target sentence matched with the input environment from the sentence prediction word bank as a candidate sentence.
Optionally, the obtaining, according to the input state, a target sentence in the sentence prediction lexicon that matches the input environment as a candidate sentence includes:
when the input method obtains input information, obtaining a target statement matched with the input environment from the sentence prediction word stock;
and acquiring the target statement matched with the input information as a candidate statement.
Optionally, the obtaining the target sentence matched with the input information as a candidate sentence includes:
acquiring the information on the screen of the input method;
and acquiring a target sentence which contains the above information and is matched with the input information as an intermediate sentence, and taking the intermediate sentence with the above information removed as a candidate sentence.
Optionally, the presenting the candidate sentences includes:
acquiring the use frequency and the last screen-on time of the candidate sentence;
and displaying the candidate sentences of which the use frequency is higher than a second preset frequency, or displaying the candidate sentences of which the last screen-up time meets a preset recommendation condition.
The embodiment of the invention also discloses a sentence recommendation device, which specifically comprises:
the device comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining the input environment of an input method when the input method is started;
the obtaining module is used for obtaining a sentence prediction word bank of the input method;
the matching module is used for acquiring a target sentence matched with the input environment in the sentence prediction word stock as a candidate sentence;
and the display module is used for displaying the candidate sentences.
Optionally, the input environment includes an application program that invokes the input method.
Optionally, the obtaining module is configured to obtain a sentence prediction lexicon set for the user account in the input method when the input method is logged in through the user account; and when the input method is not logged in through a user account, acquiring a sentence prediction word bank preset in the input method.
Optionally, the apparatus further includes an updating module, where the updating module is configured to obtain a statement displayed on a screen of the input method and a time of displaying the statement; acquiring an input environment when the sentence is displayed on the screen by the input method; and updating the sentence, the screen-up time and the input environment into the sentence prediction word stock as a record data.
Optionally, the updating module is further configured to obtain a frequency of use of the sentence in the sentence prediction lexicon and the last time of the screen display; and when the using frequency of the sentences is lower than a first preset frequency and the last screen-on time meets a preset deleting condition, deleting the recorded data corresponding to the sentences from the sentence prediction word stock.
Optionally, the matching module is configured to determine an input state of the input method; the input state is used for judging whether the input method acquires input information or not; and acquiring a target sentence matched with the input environment in the sentence prediction word bank as a candidate sentence according to the input state.
Optionally, the matching module is configured to, when input information is not obtained in the input method, obtain a target sentence matched with the input environment from the sentence prediction word bank as a candidate sentence.
Optionally, the matching module is configured to, when input information is obtained in the input method, obtain a target sentence matched with the input environment from the sentence prediction lexicon; and acquiring the target statement matched with the input information as a candidate statement.
Optionally, the matching module is configured to obtain the above information displayed on the screen of the input method; and acquiring a target sentence which contains the above information and is matched with the input information as an intermediate sentence, and taking the intermediate sentence with the above information removed as a candidate sentence.
Optionally, the presentation module is configured to obtain a frequency of use of the candidate sentence and a last screen time; and displaying the candidate sentences of which the use frequency is higher than a second preset frequency, or displaying the candidate sentences of which the last screen-up time meets a preset recommendation condition.
The embodiment of the invention also discloses a readable storage medium, and when the instructions in the storage medium are executed by a processor of the electronic equipment, the electronic equipment can execute the statement recommendation method in any one of the embodiments of the invention.
An embodiment of the present invention also discloses an electronic device, including a memory, and one or more programs, where the one or more programs are stored in the memory, and configured to be executed by one or more processors, and the one or more programs include instructions for: when the input method is called up, determining the input environment of the input method; obtaining a sentence prediction word bank of the input method; acquiring a target sentence matched with the input environment in the sentence prediction word stock as a candidate sentence; and displaying the candidate sentences.
Optionally, the input environment includes an application program that invokes the input method.
Optionally, the obtaining of the sentence prediction lexicon of the input method includes:
when the input method is logged in through a user account, a sentence prediction word bank set for the user account in the input method is obtained;
and when the input method is not logged in through a user account, acquiring a sentence prediction word bank preset in the input method.
Optionally, when the input method is invoked, before determining an input environment of the input method, the method further includes:
acquiring sentences displayed on a screen of an input method and the screen display time of the sentences;
acquiring an input environment when the sentence is displayed on the screen by the input method;
and updating the sentence, the screen-up time and the input environment into the sentence prediction word stock as a record data.
Optionally, after the sentence, the screen time and the input environment are updated into the sentence prediction lexicon as a recorded data, the method includes:
acquiring the use frequency of the sentences in the sentence prediction word stock and the last screen time;
and when the using frequency of the sentences is lower than a first preset frequency and the last screen-on time meets a preset deleting condition, deleting the recorded data corresponding to the sentences from the sentence prediction word stock.
Optionally, the obtaining a target sentence in the sentence prediction lexicon, which is matched with the input environment, as a candidate sentence includes:
determining an input state of the input method; the input state is used for representing whether the input method acquires input information or not;
and acquiring a target sentence matched with the input environment in the sentence prediction word bank as a candidate sentence according to the input state.
Optionally, the obtaining, according to the input state, a target sentence in the sentence prediction lexicon, which is matched with the input environment, as a candidate sentence includes:
and when the input method does not acquire input information, acquiring a target sentence matched with the input environment from the sentence prediction word bank as a candidate sentence.
Optionally, the obtaining, according to the input state, a target sentence in the sentence prediction lexicon that matches the input environment as a candidate sentence includes:
when the input method obtains input information, obtaining a target statement matched with the input environment from the sentence prediction word stock;
and acquiring the target statement matched with the input information as a candidate statement.
Optionally, the obtaining the target sentence matched with the input information as a candidate sentence includes:
acquiring the information of the user account on the screen of the input method;
and acquiring a target sentence which contains the above information and is matched with the input information as an intermediate sentence, and taking the intermediate sentence with the above information removed as a candidate sentence.
Optionally, the presenting the candidate sentences includes:
acquiring the use frequency and the last screen-on time of the candidate sentence;
and displaying the candidate sentences of which the use frequency is higher than a second preset frequency, or displaying the candidate sentences of which the last screen-up time meets a preset recommendation condition.
The embodiment of the invention has the following advantages:
when a user invokes an input method, the input environment of the input method is determined, the sentence prediction word stock corresponding to the input method is obtained, and sentences matched with the input environment are obtained from the sentence prediction word stock and serve as candidate sentences to be displayed. The embodiment of the invention aims at carrying out personalized statement recommendation under different input environments by a user, thereby improving the input experience of the user.
Drawings
FIG. 1 is a flow chart of the steps of an embodiment of a sentence recommendation method of the present invention;
FIG. 2 is a flow chart of the steps of an alternative embodiment of a statement recommendation method of the present invention;
FIG. 3 is a block diagram of a sentence recommendation apparatus according to an embodiment of the present invention;
FIG. 4 illustrates a block diagram of an electronic device for statement recommendation, in accordance with an exemplary embodiment;
fig. 5 is a schematic structural diagram of an electronic device for sentence recommendation according to another exemplary embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a sentence recommendation method according to the present invention is shown, which may specifically include the following steps:
step 102, when the input method is called up, determining the input environment of the input method.
Wherein the input environment comprises an application program invoking the input method. Specifically, the application program for invoking the input method may refer to an application program other than the input method, such as a chat application program, a game application program, a shopping application program, and the like, which is not limited in this embodiment of the present invention.
In the embodiment of the invention, when a user calls the input method to input in the application program, the application program is the input environment of the input method.
And 104, acquiring a sentence prediction word bank of the input method.
The input method is provided with a sentence prediction model and a sentence prediction word bank of the sentence prediction model, and sentence recommendation is carried out for a user through the sentence prediction word bank and the sentence prediction model. Wherein, the sentence prediction word stock records the sentences and input environment of the user on the screen of the input method. For example, if the user clicks the send button or the enter button, and the input method is used to display a sentence "good, ask for a question" and record the sentence and the input environment in the sentence prediction word library of the user.
In an optional example, the step 104 of obtaining a sentence prediction lexicon of the input method includes:
when the input method is logged in through a user account, a sentence prediction word bank set for the user account in the input method is obtained; and when the input method is not logged in through a user account, acquiring a sentence prediction word bank preset in the input method.
In the embodiment of the invention, a corresponding sentence prediction word bank can be set for each user account of the user, and the sentence prediction word bank corresponding to the user account is obtained when the input method is called up, so that the user switches accounts on the input method, and the corresponding sentence prediction word bank is obtained again. The embodiment of the invention can be applied to local electronic equipment or a server, when the embodiment of the invention is applied to the local electronic equipment, the sentence prediction word stock can be stored in the local electronic equipment, if a user does not log in an input method through a user account, the user can be regarded as logging in the input method through a default user account, and the sentence prediction word stock preset aiming at the default user account can be obtained from the local electronic equipment.
And 106, acquiring a target sentence matched with the input environment in the sentence prediction word stock as a candidate sentence.
Step 108, displaying the candidate sentences.
In the embodiment of the invention, the matched target sentence is obtained from the sentence prediction word bank as the candidate sentence according to the input environment of the input method, and the recommendation is carried out on the input method. Specifically, suppose that a user invokes an input method on a shopping application, a target sentence matched with the shopping application is acquired from a sentence prediction word bank and is used as a candidate sentence, and the candidate sentence is recommended in the input method.
In practice, a user has some common personalized expressions when using an input method, for example, the common expressions of different users are different when working, for example, a Taobao service can input "family in," a bank service can input "you are good, i.e., your customer manager", and in addition, different people have different habitual expressions when chatting with friends and relatives, such as chatting with friends and men, frequently inputting "family in dry, inputting" baby has eaten ", and the like. Therefore, when the input method is used, personalized statement recommendation is performed on the user, recommendation accuracy can be improved, and user input experience can be improved. Furthermore, because different user accounts are usually used by some users to distinguish life from work, the sentence prediction word stock is created for different user accounts, and the accuracy of sentence recommendation is further improved.
When the input method is called up by the user account, the input environment of the input method is determined, the sentence prediction word bank of the input method is obtained, and the sentences matched with the input environment are obtained from the sentence prediction word bank and serve as candidate sentences to be displayed. The embodiment of the invention aims at displaying personalized sentences of the user on the input method under different input environments, thereby improving the input experience of the user.
Referring to fig. 2, a flowchart illustrating steps of an alternative embodiment of a sentence recommendation method according to the present invention is shown, which may specifically include the following steps:
step 202, when the input method is called up, determining the input environment of the input method.
And step 204, obtaining a sentence prediction word bank of the input method.
In the embodiment of the invention, when a user invokes an input method on an application program, the application program is determined as the input environment of the input method, and a sentence prediction word stock created by the input method for a user account is acquired.
In one embodiment of the invention, the method further comprises:
acquiring sentences displayed on a screen of an input method and the screen display time of the sentences;
acquiring an input environment when the sentence is displayed on the screen by the input method;
and updating the sentence, the screen-up time and the input environment into the sentence prediction word stock as a record data.
In the embodiment of the invention, corresponding sentence prediction word libraries can be respectively created for each user account and the default user account, in the process of using the input method by a user, sentences which are displayed on the screen of the input method are continuously collected, and simultaneously, associated information of the sentences, such as the screen-displaying time of the sentences and the input environment of the sentences when the sentences are displayed on the screen of the input method, is also obtained, and the sentences and the associated information form a piece of recorded data and are stored in the sentence prediction word libraries. Through continuously collecting the sentences on the screen of the input method and recording the sentences in the sentence prediction word stock, the recommended content is more comprehensive when sentence recommendation is carried out based on the sentence prediction model.
In one example of the present invention, assuming that the user has "good, i've received" in the input method in the chat application, and the screen time is 20:00, the sentence "good, i've received", the screen time is 20:00, and the input environment (chat application) may be saved as a piece of recorded data in the sentence prediction lexicon. If a sentence is already stored in the sentence prediction word stock, the sentence is good and I receive the sentence, the latest screen-on time of 20:00 is updated to the record data of the sentence, and if the original input environment of the sentence is a shopping application program, the latest input environment can also be synchronously updated to the record data of the sentence.
In one embodiment of the invention, the method further comprises:
acquiring the use frequency of the sentences in the sentence prediction word stock and the last screen time;
and when the using frequency of the sentences is lower than a first preset frequency and the last screen-on time meets a preset deleting condition, deleting the recorded data corresponding to the sentences from the sentence prediction word stock.
Optionally, for the sentence prediction word stock, the use frequency is lower than the first preset frequency, and the last screen-on time meets the preset deletion condition (for example, a sentence is not used for a certain time), the recorded data of the sentence can be deleted from the sentence prediction word stock, so that the timeliness of the sentence prediction word stock is maintained, and the accuracy of sentence recommendation is ensured. The first preset frequency and the preset deleting condition can be set according to requirements.
Step 206, determining the input state of the input method; the input state is used for representing whether the input method acquires input information or not.
And 208, acquiring a target sentence matched with the input environment in the sentence prediction word bank as a candidate sentence according to the input state.
Step 210, displaying the candidate sentences.
The method comprises the steps that when an application program calls an input method, a user has a plurality of input states, for example, the input state of input information submitted by the user is not obtained in the input method, and the input state of the input information submitted by the user is obtained in the input method.
The embodiment of the invention constructs an individualized sentence prediction model and a sentence prediction word bank, collects sentences input by a user in different input environments and carries out model training, so that when the user is in different input states (inputting or has input intention) in different environments, the model and the sentence prediction word bank are used for providing sentence candidates meeting the intention of the user, and the individualized recommendation of the sentences is realized.
In an embodiment of the present invention, the step 208, acquiring, according to the input state, a target sentence in the sentence prediction lexicon, which is matched with the input environment, as a candidate sentence, includes:
and when the input method does not acquire input information, acquiring a target sentence matched with the input environment from the sentence prediction word bank as a candidate sentence.
When a user invokes an input method in a certain input environment and the input method does not acquire input information submitted by the user in the input method, target sentences in the recorded data matched with the input environment are acquired from the sentence prediction word stock and are used as candidate sentences for recommendation.
For example, when a user uses a taxi taking application program, the user often inputs a sentence "i arrive at once, ask you for a little, etc. through an input method, the input method can learn the input process, the sentence and the taxi taking application program are stored in a sentence prediction word bank, when the user opens the same taxi taking application program again, the sentence" i arrive at once, ask you for a little, etc. can be obtained without submitting any information through the input method, and the sentence is recommended to the user as a candidate sentence for screen display, so that the input efficiency of the user is improved.
In another embodiment of the present invention, the step 208 of obtaining a target sentence in the sentence prediction lexicon matching the input environment as a candidate sentence according to the input state includes:
when the input method obtains input information, obtaining a target statement matched with the input environment from the sentence prediction word stock;
and acquiring the target statement matched with the input information as a candidate statement.
In the embodiment of the invention, the input information of the user can be acquired in the process of using the input method by the user. Wherein the input information may include: in the process of inputting text by calling the input method in an application program (input environment), all information related to user input, such as interactive information, information related to other application programs calling the input method, input environment information and the like. The method and the device may also include operation information of the user in the input method application, such as setting information, and the like, which is not limited in this embodiment of the present invention.
When the user invokes the input method in the input environment and the input method obtains the input information submitted by the user in the input method, the target sentences in the recorded data matched with the input environment can be obtained from the sentence prediction word stock, and the target sentences matched with the input information are used as candidate sentences.
In an embodiment of the present invention, the obtaining the target sentence matched with the input information as a candidate sentence includes:
acquiring the information on the screen of the input method;
and acquiring a target sentence which contains the above information and is matched with the input information as an intermediate sentence, and taking the intermediate sentence with the above information removed as a candidate sentence.
The above information refers to a part of sentences which are already displayed on the screen of the input method. Because the embodiment of the invention recommends sentences, and a user may acquire a plurality of sentences which are not particularly related under the condition that the input information submitted by the input method is incomplete, in order to improve the recommendation accuracy, the embodiment of the invention takes the target sentence which is simultaneously matched with the above information and the input information as an intermediate sentence, and then takes the intermediate sentence from which the above information is removed as a candidate sentence.
For example, when a user replies to other users in a certain input environment, the user usually replies "good, i understand" and the sentence prediction word library can store the sentence and the associated information of the sentence as data records. When the user screens the information 'good' on the input method and inputs the information pinyin 'wo' on the input method, the intermediate sentence 'good and understood' can be predicted, then the partial sentences which are already screened in the intermediate sentence 'good' are removed, the candidate sentences 'I understood' can be obtained, the sentences are recommended to the user as the candidate sentences for screening, and the input efficiency of the user can be improved.
In one embodiment of the present invention, step 208, said presenting said candidate sentences comprises:
acquiring the use frequency and the last screen-on time of the candidate sentence;
and displaying the candidate sentences of which the use frequency is higher than a second preset frequency, or displaying the candidate sentences of which the last screen-up time meets a preset recommendation condition.
In order to ensure the accuracy of sentence recommendation and prevent an uncommon and mistakenly input sentence from being recommended, in the embodiment of the present invention, after determining a candidate sentence, the use frequency of the candidate sentence or the last screen time may be obtained, and for the candidate sentence with the use frequency higher than the second preset frequency, or the last screen time that has already satisfied the preset recommendation condition (for example, the sentence has been used within a certain time recently), the candidate sentence is taken as the candidate sentence. After the candidate sentences are acquired, the candidate sentences can be displayed on an input method for a user to determine to screen. The second preset frequency and the preset recommendation condition can be set according to requirements.
To sum up, the embodiment of the present invention sets an individualized sentence prediction model and a corresponding sentence prediction lexicon in an input method application, and continuously collects sentences that are displayed or sent by a user in an input method input process, and relevant information such as a corresponding input environment, a corresponding display time, and the like to update the sentence prediction lexicon, and then the updated sentence prediction lexicon updates the model, so that in the user input method input process, based on information such as a current input environment, a current system time, previous information, and input information of the user, the individualized candidate sentences are provided to be displayed to the user for selection through the sentence prediction model, and user input experience is improved.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 3, a block diagram of a sentence recommendation apparatus according to an embodiment of the present invention is shown, and specifically, the sentence recommendation apparatus may include the following modules:
a determining module 302, configured to determine an input environment of an input method when the input method is invoked;
an obtaining module 304, configured to obtain a sentence prediction word library of the input method;
a matching module 306, configured to obtain a target sentence, which is matched with the input environment, in the sentence prediction lexicon as a candidate sentence;
a presentation module 308, configured to present the candidate sentence.
In one example of the present invention, the input environment includes an application program that invokes the input method.
In an example of the present invention, the obtaining module 304 is configured to, when the input method is logged in through a user account, obtain a sentence prediction lexicon set for the user account in the input method; and when the input method is not logged in through a user account, acquiring a sentence prediction word bank preset in the input method.
In an example of the present invention, the apparatus further includes an updating module, configured to obtain a statement displayed on a screen of an input method and a screen display time of the statement; acquiring an input environment when the sentence is displayed on the screen by the input method; and updating the sentence, the screen-up time and the input environment into the sentence prediction word stock as a record data.
In an example of the present invention, the updating module is further configured to obtain a usage frequency of the sentence in the sentence prediction lexicon and the last time of the screen; and when the using frequency of the sentences is lower than a first preset frequency and the last screen-on time meets a preset deleting condition, deleting the recorded data corresponding to the sentences from the sentence prediction word stock.
In an example of the present invention, the matching module 306 is configured to determine an input state of the input method; the input state is used for representing whether the input method acquires input information or not; and acquiring a target sentence matched with the input environment in the sentence prediction word bank as a candidate sentence according to the input state.
In an example of the present invention, the matching module 306 is configured to, when input information is not obtained in the input method, obtain a target sentence matching the input environment from the sentence prediction lexicon as a candidate sentence.
In an example of the present invention, the matching module 306 is configured to, when input information is obtained in the input method, obtain a target sentence matched with the input environment from the sentence prediction lexicon; and acquiring the target statement matched with the input information as a candidate statement.
In an example of the present invention, the matching module 306 is configured to obtain the above information displayed on the input method; and acquiring a target sentence which contains the above information and is matched with the input information as an intermediate sentence, and taking the intermediate sentence with the above information removed as a candidate sentence.
In an example of the present invention, the presentation module 308 is configured to obtain a frequency of use and a last screen time of the candidate sentence; and displaying the candidate sentences of which the use frequency is higher than a second preset frequency, or displaying the candidate sentences of which the last screen-up time meets a preset recommendation condition.
In summary, in the embodiment of the present invention, when a user invokes an input method, an input environment of the input method is determined, and a sentence prediction lexicon of the input method is obtained, so that a sentence matched with the input environment is obtained from the sentence prediction lexicon and is displayed as a candidate sentence. The embodiment of the invention aims at personalized statement display of the user in different input environments, thereby improving the input experience of the user.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
FIG. 4 is a block diagram illustrating an architecture of an electronic device 400 for statement recommendation, according to an example embodiment. For example, the electronic device 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 4, electronic device 400 may include one or more of the following components: a processing component 402, a memory 404, a power component 406, a multimedia component 408, an audio component 410, an interface for input/output (I/O) 412, a sensor component 414, and a communication component 416.
The processing component 402 generally controls overall operation of the electronic device 400, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing element 402 may include one or more processors 420 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 402 can include one or more modules that facilitate interaction between the processing component 402 and other components. For example, the processing component 402 can include a multimedia module to facilitate interaction between the multimedia component 408 and the processing component 402.
The memory 404 is configured to store various types of data to support operations at the device 400. Examples of such data include instructions for any application or method operating on the electronic device 400, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 404 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power components 406 provide power to the various components of electronic device 400. Power components 406 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for electronic device 400.
The multimedia component 408 comprises a screen providing an output interface between the electronic device 400 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 400 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 410 is configured to output and/or input audio signals. For example, the audio component 410 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 400 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 404 or transmitted via the communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.
The I/O interface 412 provides an interface between the processing component 402 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 414 includes one or more sensors for providing various aspects of status assessment for the electronic device 400. For example, the sensor component 414 can detect an open/closed state of the device 400, the relative positioning of components, such as a display and keypad of the electronic device 400, the sensor component 414 can also detect a change in the position of the electronic device 400 or a component of the electronic device 400, the presence or absence of user contact with the electronic device 400, orientation or acceleration/deceleration of the electronic device 400, and a change in the temperature of the electronic device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 416 is configured to facilitate wired or wireless communication between the electronic device 400 and other devices. The electronic device 400 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 414 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 414 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 404 comprising instructions, executable by the processor 420 of the electronic device 400 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform a sentence recommendation method, the method comprising: when the input method is called up, determining the input environment of the input method; obtaining a sentence prediction word bank of the input method; acquiring a target sentence matched with the input environment in the sentence prediction word stock as a candidate sentence; and displaying the candidate sentences.
Optionally, the input environment includes an application program that invokes the input method.
Optionally, the obtaining of the sentence prediction lexicon of the input method includes:
when the input method is logged in through a user account, a sentence prediction word bank set for the user account in the input method is obtained;
and when the input method is not logged in through a user account, acquiring a sentence prediction word bank preset in the input method.
Optionally, when the input method is invoked, before determining an input environment of the input method, the method further includes:
acquiring sentences displayed on a screen of an input method and the screen display time of the sentences;
acquiring an input environment when the sentence is displayed on the screen by the input method;
and updating the sentence, the screen-up time and the input environment into the sentence prediction word stock as a record data.
Optionally, after the sentence, the screen time and the input environment are updated into the sentence prediction lexicon as a recorded data, the method includes:
acquiring the use frequency of the sentences in the sentence prediction word stock and the last screen time;
and when the using frequency of the sentences is lower than a first preset frequency and the last screen-on time meets a preset deleting condition, deleting the recorded data corresponding to the sentences from the sentence prediction word stock.
Optionally, the obtaining a target sentence in the sentence prediction lexicon, which is matched with the input environment, as a candidate sentence includes:
determining an input state at the input method; the input state is used for representing whether the input method acquires input information or not;
and acquiring a target sentence matched with the input environment in the sentence prediction word bank as a candidate sentence according to the input state.
Optionally, the obtaining, according to the input state, a target sentence in the sentence prediction lexicon, which is matched with the input environment, as a candidate sentence includes:
and when the input method does not acquire input information, acquiring a target sentence matched with the input environment from the sentence prediction word bank.
Optionally, the obtaining, according to the input state, a target sentence in the sentence prediction lexicon that matches the input environment as a candidate sentence includes:
when the input method obtains input information, obtaining a target statement matched with the input environment from the sentence prediction word stock;
and acquiring the target statement matched with the input information as a candidate statement.
Optionally, the obtaining the target sentence matched with the input information as a candidate sentence includes:
acquiring the information on the screen of the input method;
and acquiring a target sentence which contains the above information and is matched with the input information as an intermediate sentence, and taking the intermediate sentence with the above information removed as a candidate sentence.
Optionally, the presenting the candidate sentences includes:
acquiring the use frequency and the last screen-on time of the candidate sentence;
and displaying the candidate sentences of which the use frequency is higher than a second preset frequency, or displaying the candidate sentences of which the last screen-up time meets a preset recommendation condition.
Fig. 5 is a schematic structural diagram of an electronic device 500 for sentence recommendation according to another exemplary embodiment of the present invention. The electronic device 500 may be a server, which may vary greatly due to configuration or performance, and may include one or more Central Processing Units (CPUs) 522 (e.g., one or more processors) and memory 532, one or more storage media 530 (e.g., one or more mass storage devices) storing applications 542 or data 544. Memory 532 and storage media 530 may be, among other things, transient storage or persistent storage. The program stored on the storage medium 530 may include one or more modules (not shown), each of which may include a series of instruction operations for the server. Still further, the central processor 522 may be configured to communicate with the storage medium 530, and execute a series of instruction operations in the storage medium 530 on the server.
The server may also include one or more power supplies 526, one or more wired or wireless network interfaces 550, one or more input-output interfaces 558, one or more keyboards 556, and/or one or more operating systems 541, such as WindowsServerTM, MacOS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
An electronic device comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors the one or more programs including instructions for: when the input method is called up, determining the input environment of the input method; obtaining a sentence prediction word bank of the input method; acquiring a target sentence matched with the input environment in the sentence prediction word stock as a candidate sentence; and displaying the candidate sentences.
Optionally, the input environment includes an application program that invokes the input method.
Optionally, the obtaining of the sentence prediction lexicon of the input method includes:
when the input method is logged in through a user account, a sentence prediction word bank set for the user account in the input method is obtained;
and when the input method is not logged in through a user account, acquiring a sentence prediction word bank preset in the input method.
Optionally, when the input method is invoked, before determining an input environment of the input method, the method further includes:
acquiring sentences displayed on a screen of an input method and the screen display time of the sentences;
acquiring an input environment when the sentence is displayed on the screen by the input method;
and updating the sentence, the screen-up time and the input environment into the sentence prediction word stock as a record data.
Optionally, after the sentence, the screen time and the input environment are updated into the sentence prediction lexicon as a recorded data, the method includes:
acquiring the use frequency of the sentences in the sentence prediction word stock and the last screen time;
and when the using frequency of the sentences is lower than a first preset frequency and the last screen-on time meets a preset deleting condition, deleting the recorded data corresponding to the sentences from the sentence prediction word stock.
Optionally, the obtaining a target sentence in the sentence prediction lexicon, which is matched with the input environment, as a candidate sentence includes:
determining an input state at the input method; the input state is used for representing whether the input method acquires input information or not;
and acquiring a target sentence matched with the input environment in the sentence prediction word bank as a candidate sentence according to the input state.
Optionally, the obtaining, according to the input state, a target sentence in the sentence prediction lexicon, which is matched with the input environment, as a candidate sentence includes:
when input information is not acquired in the input method, acquiring a target sentence matched with the input environment from the sentence prediction word stock as a candidate sentence;
and taking the target statement with the use frequency higher than a second preset frequency as a candidate statement.
Optionally, the obtaining, according to the input state, a target sentence in the sentence prediction lexicon that matches the input environment as a candidate sentence includes:
when the input method acquires input information, acquiring a target sentence matched with the input environment from the sentence prediction word stock as a candidate sentence;
and acquiring the target statement matched with the input information as a candidate statement.
Optionally, the obtaining the target sentence matched with the input information as a candidate sentence includes:
acquiring the information on the screen of the input method;
and acquiring a target sentence which contains the above information and is matched with the input information as an intermediate sentence, and taking the intermediate sentence with the above information removed as a candidate sentence.
Optionally, the presenting the candidate sentences includes:
acquiring the use frequency and the last screen-on time of the candidate sentence;
and displaying the candidate sentences of which the use frequency is higher than a second preset frequency, or displaying the candidate sentences of which the last screen-up time meets a preset recommendation condition.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The sentence recommendation method, the sentence recommendation device and the electronic device provided by the invention are introduced in detail, and a specific example is applied in the text to explain the principle and the implementation of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A sentence recommendation method, comprising:
when the input method is called up, determining the input environment of the input method;
obtaining a sentence prediction word bank of the input method;
acquiring a target sentence matched with the input environment in the sentence prediction word stock as a candidate sentence;
and displaying the candidate sentences.
2. The method of claim 1, wherein the input environment comprises an application that invokes the input method.
3. The method of claim 1, wherein obtaining the sentence prediction lexicon of the input method comprises:
when the input method is logged in through a user account, a sentence prediction word bank set for the user account in the input method is obtained;
and when the input method is not logged in through a user account, acquiring a sentence prediction word bank preset in the input method.
4. The method of claim 2, wherein, when invoking an input method, prior to determining an input context for the input method, the method further comprises:
acquiring sentences displayed on a screen of an input method and the screen display time of the sentences;
acquiring an input environment when the sentence is displayed on the screen by the input method;
and updating the sentence, the screen-up time and the input environment into the sentence prediction word stock as a record data.
5. The method of claim 4, wherein after said updating said sentence, said screen time and said input context as a recorded datum into said sentence prediction lexicon, said method further comprises:
acquiring the use frequency of the sentences in the sentence prediction word stock and the last screen time;
and when the using frequency of the sentences is lower than a first preset frequency and the last screen-on time meets a preset deleting condition, deleting the recorded data corresponding to the sentences from the sentence prediction word stock.
6. The method of claim 1, wherein the obtaining a target sentence in the sentence prediction lexicon that matches the input environment as a candidate sentence comprises:
determining an input state at the input method; the input state is used for representing whether the input method acquires input information or not;
and acquiring a target sentence matched with the input environment in the sentence prediction word bank as a candidate sentence according to the input state.
7. The method according to claim 6, wherein the obtaining, according to the input state, a target sentence in the sentence prediction lexicon that matches the input environment as a candidate sentence comprises:
and when the input method does not acquire input information, acquiring a target sentence matched with the input environment from the sentence prediction word bank as a candidate sentence.
8. A sentence recommendation apparatus comprising:
the device comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining the input environment of an input method when the input method is started;
the obtaining module is used for obtaining a sentence prediction word bank of the input method;
the matching module is used for acquiring a target sentence matched with the input environment in the sentence prediction word stock as a candidate sentence;
and the display module is used for displaying the candidate sentences.
9. An electronic device comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors the one or more programs including instructions for:
when the input method is called up, determining the input environment of the input method;
obtaining a sentence prediction word bank of the input method;
acquiring a target sentence matched with the input environment in the sentence prediction word stock as a candidate sentence;
and displaying the candidate sentences.
10. A readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the sentence recommendation method of any of method claims 1-7.
CN202010683244.XA 2020-07-15 2020-07-15 Statement recommendation method and device, electronic equipment and readable storage medium Pending CN113946228A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010683244.XA CN113946228A (en) 2020-07-15 2020-07-15 Statement recommendation method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010683244.XA CN113946228A (en) 2020-07-15 2020-07-15 Statement recommendation method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN113946228A true CN113946228A (en) 2022-01-18

Family

ID=79326484

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010683244.XA Pending CN113946228A (en) 2020-07-15 2020-07-15 Statement recommendation method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113946228A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114791769A (en) * 2022-06-24 2022-07-26 湖北云享客数字智能科技有限公司 Big database establishment method for user behavior prediction result

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114791769A (en) * 2022-06-24 2022-07-26 湖北云享客数字智能科技有限公司 Big database establishment method for user behavior prediction result

Similar Documents

Publication Publication Date Title
EP3171270A1 (en) Method and device for information push
US20160314164A1 (en) Methods and devices for sharing cloud-based business card
CN106815291B (en) Search result item display method and device and search result item display device
CN111046210A (en) Information recommendation method and device and electronic equipment
CN108803892B (en) Method and device for calling third party application program in input method
CN112445906A (en) Method and device for generating reply message
CN110648657A (en) Language model training method, language model construction method and language model construction device
CN112784151B (en) Method and related device for determining recommended information
CN110213062B (en) Method and device for processing message
CN113946228A (en) Statement recommendation method and device, electronic equipment and readable storage medium
CN111679746A (en) Input method and device and electronic equipment
CN109901726B (en) Candidate word generation method and device and candidate word generation device
CN111831132A (en) Information recommendation method and device and electronic equipment
CN108108356B (en) Character translation method, device and equipment
CN113807540A (en) Data processing method and device
CN112363631A (en) Input method, input device and input device
CN113946346B (en) Data processing method and device, electronic equipment and storage medium
CN112242142B (en) Voice recognition input method and related device
CN112632279B (en) Method and related device for determining user tag
CN114527919B (en) Information display method and device and electronic equipment
CN111914983B (en) Interaction method and device, sound box, electronic equipment and storage medium
CN114201058A (en) Input method and device and electronic equipment
CN110020244B (en) Method and device for correcting website information
CN114594862A (en) Recommendation method and device and electronic equipment
CN114690912A (en) Input method and device and electronic equipment

Legal Events

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