WO2018024166A1 - 确定候选输入的方法、输入提示方法和电子设备 - Google Patents

确定候选输入的方法、输入提示方法和电子设备 Download PDF

Info

Publication number
WO2018024166A1
WO2018024166A1 PCT/CN2017/094953 CN2017094953W WO2018024166A1 WO 2018024166 A1 WO2018024166 A1 WO 2018024166A1 CN 2017094953 W CN2017094953 W CN 2017094953W WO 2018024166 A1 WO2018024166 A1 WO 2018024166A1
Authority
WO
WIPO (PCT)
Prior art keywords
candidate
input
sentence
candidate sentence
occurrence
Prior art date
Application number
PCT/CN2017/094953
Other languages
English (en)
French (fr)
Inventor
罗平
周干斌
林芬
路彦雄
曹荣禹
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to EP17836348.7A priority Critical patent/EP3495928A4/en
Publication of WO2018024166A1 publication Critical patent/WO2018024166A1/zh
Priority to US16/011,216 priority patent/US11050685B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/02User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail using automatic reactions or user delegation, e.g. automatic replies or chatbot-generated messages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/18Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
    • 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/0236Character input methods using selection techniques to select from displayed items
    • 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
    • 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/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04812Interaction techniques based on cursor appearance or behaviour, e.g. being affected by the presence of displayed objects
    • 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/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04886Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures by partitioning the display area of the touch-screen or the surface of the digitising tablet into independently controllable areas, e.g. virtual keyboards or menus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/253Grammatical analysis; Style critique
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/274Converting codes to words; Guess-ahead of partial word inputs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/21Monitoring or handling of messages
    • H04L51/222Monitoring or handling of messages using geographical location information, e.g. messages transmitted or received in proximity of a certain spot or area

Definitions

  • the present invention relates to the field of Internet technologies, and in particular, to a method for determining candidate input, an input prompting method, and an electronic device.
  • some input methods provide candidate input for the user according to the text input by the user. For example, when the user inputs "hello”, the input method provides the user with "?", "! and other candidate inputs for the user to select. .
  • the candidate input provided by the input method is generated according to the common sentence and the user's input record, usually a single word or a short word.
  • the input method provides a candidate option for the user to input, but since "now outside” is not a regular word, the option of "outside” does not appear in the candidate option, so the user inputs the word "outside”.
  • the candidate option provided by the input method will include the "face” word for the user to select.
  • the candidate options provided by the law may have the option of "raining”, and after the user selects "rain”, the candidate options provided have the option of punctuation ",”. After the user selects ",”, there is no candidate.
  • the option is provided, the user input “remember”, according to the "remember” input by the user, the candidate input provided by the input method has no “with umbrella” option, and the user uses Enter the "umbrella” to complete the entry.
  • a method of determining candidate inputs, an input prompting method, and an electronic device are provided.
  • a method of determining candidate inputs including:
  • the possible connected words each having the end identifier are respectively connected to the corresponding candidate sentences to obtain candidate sentences each having the ending recognition;
  • the occurrence probabilities of the candidate sentences each having the end identification are respectively calculated according to the above and/or the following, and the preset candidate sentences having the end identification having the highest occurrence probability are taken as candidate inputs.
  • An input prompt method including:
  • the possible connected words each having the end identifier are respectively connected to the corresponding candidate sentences to obtain candidate sentences each having the ending recognition;
  • the candidate input is displayed in a corresponding position of the cursor in the input interface.
  • An electronic device comprising a memory and a processor, the memory storing computer readable instructions, the computer readable instructions being executed by the processor such that the processor performs the following steps:
  • the possible connected words each having the end identifier are respectively connected to the corresponding candidate sentences to obtain candidate sentences each having the ending recognition;
  • the occurrence probabilities of the candidate sentences each having the end identification are respectively calculated according to the above and/or the following, and the preset candidate sentences having the end identification having the highest occurrence probability are taken as candidate inputs.
  • An electronic device comprising a memory and a processor, the memory storing computer readable instructions, the computer readable instructions being executed by the processor such that the processor performs the following steps:
  • the possible connected words each having the end identifier are respectively connected to the corresponding candidate sentences to obtain candidate sentences each having the ending recognition;
  • the candidate input is displayed in a corresponding position of the cursor in the input interface.
  • FIG. 1 is a schematic diagram of an application environment of a method for determining candidate input in an embodiment
  • FIG. 2 is a schematic diagram of an application environment of a method for determining candidate input in still another embodiment
  • FIG. 3 is a schematic diagram showing the internal structure of a terminal in an embodiment
  • FIG. 4 is a flow chart of a method of determining candidate inputs in one embodiment
  • Figure 5 is a flow chart showing the steps of updating candidate sentences in one embodiment
  • FIG. 6 is a flow chart of a method of determining candidate inputs in yet another embodiment
  • FIG. 7 is a flow chart of an input prompting method in an embodiment
  • FIG. 8 is a schematic diagram of an interface for displaying candidate inputs on an input interface in one embodiment
  • FIG. 9 is a schematic diagram of an interface for automatically replying according to candidate inputs in an embodiment
  • Figure 10 is a flow chart showing an input prompting method in still another embodiment
  • FIG. 11 is a structural block diagram of an electronic device in an embodiment
  • FIG. 13 is a structural block diagram of an electronic device in another embodiment
  • Figure 14 is a block diagram showing the structure of an electronic device in still another embodiment.
  • FIG. 1 is a schematic diagram of an application environment of a method for determining candidate input in an embodiment.
  • the application environment includes a first terminal 110, a server 120, and a second terminal 130.
  • the first terminal 110 and the second terminal 130 communicate with the server 120 over a network.
  • the first user logs in to the first terminal 110
  • the terminal or the server acquires the input text of the above and the input box of the first user at the current input position, the candidate input is determined according to the input text of the input box and the above.
  • FIG. 2 is a schematic diagram of an application environment of a method for determining candidate inputs in another embodiment.
  • the first terminal 210 and the server 220 are included.
  • the first user performs text input on the first terminal 210, for example, text editing.
  • the terminal or the server obtains the input text of the current statement in which the first user is in the current input position and the previous and/or below and the current input position is located, according to the input text of the input box, above and/or below Candidate input.
  • the server 220 transmits the determined candidate input to the first terminal 210 after determining the candidate input.
  • the application environment of the method of determining candidate input in another embodiment may include only the first terminal.
  • the terminal when the terminal acquires the input text of the current statement in which the user has a preset number of the above and/or below and the current input position at the current input position, according to the input text of the input box, the above and / Or determine the candidate input below.
  • FIG. 3 is a schematic diagram showing the internal structure of a terminal in an embodiment.
  • the terminal includes a processor connected through a system bus, a non-volatile storage medium, a display screen, an internal memory, a network interface, and an input device.
  • the storage medium of the terminal stores an operating system, and further stores computer readable instructions, which when executed by the processor, enable the processor to implement a method for determining a candidate input.
  • the processor is used to provide computing and control capabilities to support the operation of the entire terminal.
  • the internal memory in the terminal provides a cached operating environment for operating systems and computer executable instructions in a non-volatile storage medium.
  • the network interface is used for network communication with the server, such as the text input by the user is sent to the server, the input text sent by the chat object returned by the server is received, and the input device is used to accept the input of the user.
  • the display of the terminal can be a liquid crystal display or an electronic ink display.
  • the input device may be a touch layer covered on the display screen, a button, a trackball or a touchpad provided on the terminal casing, or an external keyboard, a touchpad or a mouse.
  • the terminal can be a mobile phone, a tablet or a personal digital assistant or a wearable device. A person skilled in the art can understand that the structure shown in FIG.
  • FIG. 3 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the terminal to which the solution of the present application is applied.
  • the specific terminal may include a ratio. More or fewer components are shown in the figures, or some components are combined, or have different component arrangements.
  • FIG. 4 is a flow chart of a method of determining candidate inputs in one embodiment. As shown in FIG. 4, a method for determining candidate input, the method for determining candidate input is performed on the first terminal 110 or the second terminal 130 as shown in FIG. 1, or the first terminal 210 shown in FIG. on. The method in this embodiment comprises the following steps:
  • S402 Acquire an input text of the current input position in the input interface that is less than or equal to a preset number of current statements of the above and/or below, the current input position in the above.
  • the current input position refers to the location where the cursor is located.
  • the context of the cursor position includes the following cases: the position where the cursor is located has the above and the following conditions, for example, in the context of text editing, at this time, the preset number of the current input position is obtained above and below.
  • the location of the cursor is only the above, for example, in the chat environment, at this time, the preset number of the current input location is obtained above.
  • the cursor is located only in the following cases, for example, in the context of text editing, at this time, the preset number of the current input position is obtained below.
  • the preset number above and the preset number below may be the same or different, and may be set by the user or the developer according to the specific situation.
  • an environment for text editing can be determined based on the punctuation marks in the above position of the cursor.
  • each sentence is distinguished by ".”, "?" or "!.
  • the corresponding punctuation is searched forward from the last word, and the corresponding punctuation to the last word ending above is the input text of the current sentence.
  • the text entered in the input box is used as the input text of the current statement in which the current input position is located.
  • a set of candidate sentences can be created, and the input text is used as an element in the candidate sentence set, that is, the candidate sentence in this embodiment.
  • S406 Calculate possible connective words of the preset corresponding candidate sentences with the highest probability of occurrence according to the candidate sentence and the above and/or the following.
  • the language model can be trained based on a neural network in advance using different session sets or documents.
  • the candidate sentences in the candidate sentence set are input into the pre-trained language model, the probability of occurrence of possible connective words and possible connected words of the candidate sentence is calculated, and the possible connective words of the preset candidate sentences with the highest probability of occurrence are selected.
  • the specific number of presets can be set by the system developer or user preset.
  • step S408 Determine whether the end condition of the candidate sentence update is reached. If yes, step S410 is performed.
  • the language model adds a start identifier and an end marker to each sentence being trained during training.
  • the start and end identifiers of an embodiment may be the same, for example both ⁇ END> symbols. It can be understood that when the input text of the current statement in which the current input position is located above and/or below and above is input into the language model, the start identifier and the end identifier will also be added to one sentence.
  • a possible conjunction is calculated using a language model, when the possible conjunction has an end identifier, the possible conjunction is considered to be the end of the current statement.
  • each possible connective word with the end identifier is connected to the corresponding candidate sentence to obtain a candidate sentence with an end identifier.
  • a result set can be created, and the candidate sentence with the end identifier is placed into the result set, and the candidate sentence with the end identifier is used as the element of the result set. It will be appreciated that the result set includes candidate sentences for each update and their possible conjunctions with an end identifier.
  • S412 Calculate an appearance probability of each candidate sentence having an end identifier according to the above and/or the following, and select a candidate sentence having an end identifier with the highest probability of occurrence as a candidate input.
  • the initial candidate sentence is the input text of the current sentence.
  • each possible connected word with the end identifier is respectively connected to the corresponding candidate.
  • the candidate sentences each having the ending recognition are obtained in the sentence, and the occurrence probabilities of the candidate sentences each having the end identifier are respectively calculated according to the above and/or the following, and the preset candidate sentences having the ending identifier having the highest occurrence probability are used as the candidate inputs.
  • the calculated possible conjunctions can provide contextual contextual candidate inputs taking into account the above and/or below input conditions.
  • the user can increase the input efficiency without having to input a long sentence multiple times.
  • step S409 is performed.
  • each possible connective word having no end identifier is respectively connected to the update candidate sentence among the corresponding candidate sentence.
  • the updated candidate sentence consists of a pre-update candidate sentence and a possible connection word without an end identifier.
  • all possible candidate words in the candidate sentence set that do not have the ending identifier are connected to the candidate sentence after the corresponding candidate sentence is updated, and the updated candidate sentences constitute the updated candidate sentence set.
  • step S409 the process returns to step S406 to calculate the possible connected words of the updated candidate sentences in the updated candidate sentence set, and obtain the possible connected words of the preset updated candidate sentences with the highest probability of occurrence.
  • the possible connective words of the candidate sentence are cyclically calculated.
  • Multiple loop calculations may connect words, and can continuously increase the number of words to form candidate inputs for long sentences.
  • Step S409 connecting each possible connected word having no end identifier to the corresponding candidate sentence and then updating the candidate sentence as an update candidate sentence.
  • the step of updating the candidate sentence includes: :
  • S4092 Calculate the probability of occurrence of each preliminary update candidate sentence according to the above and/or the following.
  • a plurality of updated candidate sentences are correspondingly obtained. Since the possible connective words of the candidate sentence are calculated cyclically when the end condition of the candidate sentence update is not reached, in each of the updated candidate sentences, it is possible to obtain a plurality of possible non-end identifiers for each updated candidate sentence. Connect words to get multiple updated candidate sentences. When there are more candidate sentences to be updated, the amount of calculation increases, resulting in slow calculation of candidate inputs.
  • the end condition of the candidate sentence update may include that all possible connective words of each candidate sentence have an end identifier.
  • all the possible connected words of each candidate sentence have an end acquaintance (at this time, the element of the candidate sentence set is empty)
  • the end condition of the candidate sentence update is reached, and the possible connected words each having the end identifier are respectively Connecting to the corresponding candidate sentences results in candidate sentences each having an ending acquaintance.
  • the method may further include: accumulating the number of times the candidate sentence is updated.
  • the end condition of the candidate sentence update may include: updating the number of times the candidate sentence reaches the set maximum value, so that when the number of times the candidate sentence is updated reaches the set maximum value, When the above N is equal to the set maximum value, the end condition of the candidate sentence update is reached, and the step of connecting each possible connected word having the end identifier to the candidate sentence to obtain each candidate sentence having the end of the recognition is performed.
  • the calculation speed of the candidate input can be improved by limiting the number of times of the loop calculation within a certain number of times.
  • step S402 may include: obtaining an input text and a language style of the current input position in the input interface that is less than or equal to a preset number of the current and above or below, the current input position of the current input position. parameter.
  • the language style refers to the style of the language in which the text is entered.
  • Language style is associated with word habits, professional areas and speech.
  • the language style parameter can be set in advance on the input device application on the terminal device.
  • the language style parameters of an embodiment include the user's habit of being a network buzzword and the speaking tone being playful.
  • step S406 may specifically be: calculating, according to the candidate sentence and the above and/or the following, possible connective words of the preset candidate sentences having the highest probability of occurrence corresponding to the language style parameter.
  • the candidate input thus obtained is a candidate input corresponding to the language style.
  • different language style models are trained to obtain different language style models, and the input characters of the current position of the input position that are less than or equal to a preset number of the above and/or below and the current input position in the above are input into the corresponding language.
  • possible connective words corresponding to the language style parameters are calculated.
  • the candidate input with the same language style parameter can be determined, and the obtained candidate input can be more conformed to the language habit of the user, and the personalized setting of the user's language style can be realized.
  • the language model is pre-trained based on a neural network using multiple sets of dialogs and multiple documents.
  • a group of conversations is among them It is the jth sentence of the i-group dialogue.
  • a document set consists of multiple documents ⁇ d 1 , d 2 ,..., d n ⁇ .
  • Each document is composed of multiple sentences, recorded as among them Is the jth sentence of the i-th document.
  • the method for determining a candidate input using a language model in a chat environment is specifically, assuming that the user gives a j-1 sentence ⁇ a 1 , a 2 , . . . , a j-1 ⁇ before the current conversation. And the z words ⁇ a j1 , a j2 , . . . , a jz ⁇ at the beginning of the current input statement a j are calculated using a language model The largest u a j .
  • the method for determining a candidate input using a language model in a non-chat environment is specifically, assuming that the user gives a j-1 sentence ⁇ a 1 , a 2 , . . .
  • u is a positive integer, that is, the number of possible connective words of the candidate sentence with the highest probability of occurrence and the number of candidate inputs with the highest probability.
  • the j-1 sentence before the current conversation and the z words at the beginning of the current input sentence a j are input into the language model, or the j-1 sentence before the current document editing position, after the current document editing position
  • the z words at the beginning of the current input sentence a j are input into the language model, and the z words possible connected words at the beginning of the u current input sentences a j having the highest probability are calculated.
  • each possible connective word having no end identifier is respectively connected to the corresponding candidate sentence, and the candidate sentence is updated, and the updated candidate sentence is separately input into the language model, and the updated version is calculated.
  • the method of determining candidate inputs as described above may also be run on server 120 as shown in FIG. 1 or server 220 as shown in FIG. In this case, as shown in FIG. 6, after step S412, the method may further include:
  • the method for determining the candidate input in the embodiment runs on the server. It can be understood that the server receives the current input position in the input interface sent by the terminal that is less than or equal to the preset number of the above and/or below, the current input in the above. The input text of the current statement where the position is located, and the candidate input is determined based on the obtained data. The determined candidate input is sent to the corresponding terminal device.
  • the terminal device determines, by the server, that the input text of the current input position in the input interface that is less than or equal to a preset number of the current statement of the above and/or below and the current input position is sent to the server.
  • the candidate input can solve the problem that the computing power of the local device is insufficient, and the candidate input is quickly calculated by using the computing power of the server, and then the calculated candidate input is sent to the terminal device.
  • an embodiment of the present invention further provides an input prompting method, where the input prompting method runs on the first terminal 110 or the second terminal 130 as shown in FIG. As shown in FIG. 7, the method may specifically include the following steps:
  • S702 Acquire an input text of the current input position in the input interface that is less than or equal to a preset number of the current statement of the above and/or below, the current input position in the above.
  • S706 Calculate possible connective words of the preset corresponding candidate sentences with the highest probability of occurrence according to the candidate sentence and the above and/or the following.
  • step S708 Determine whether the end condition of the candidate sentence update is reached. If yes, step S710 is performed.
  • S710 Connect each possible connected word with an end identifier to a corresponding candidate sentence to obtain a candidate sentence each having an ending acquaintance.
  • S712 Calculate an appearance probability of each candidate sentence having an end identifier according to the above and/or the following, and select a candidate sentence having an end identifier with the highest probability of occurrence as a candidate input.
  • step S709 is performed: connecting the possible connected words each having no end identifier to the corresponding candidate sentence respectively, and then updating the candidate sentence.
  • step S709 the process returns to step S706 to calculate the possible connected words of the updated candidate sentences in the updated candidate sentence set, and obtain the possible connected words of the preset updated candidate sentences with the highest probability of occurrence.
  • step S712 the steps are performed:
  • FIG. 8 A schematic diagram of an interface for displaying candidate inputs on a terminal device in a specific example is shown in FIG. 8.
  • the user can intuitively view the candidate input and select the candidate input, which brings convenience to the user's input operation and improves the input efficiency of the user.
  • step S714 the following steps are further included:
  • the candidate input with the highest probability of occurrence is obtained; the candidate input with the highest probability of occurrence is input into the input box and sent.
  • the setting status may include a status of leaving, busy, or do not disturb.
  • chat tools such as instant messaging
  • users can set whether they need to automatically reply when they are away, busy, or do not disturb.
  • the existing automatic reply message is usually a reply message that the user has set when setting the automatic reply, for example, "I have gone to eat, one
  • the chat record with the other party is acquired, the candidate input is calculated according to the chat record, and the candidate with the highest probability is input.
  • the candidate input is based on the user's point of view, and is determined according to the chat record, and conforms to the context of the current chat.
  • FIG. The schematic diagram of an automatic reply interface of an embodiment is shown in FIG. .
  • a chat environment is taken as an example.
  • a specific implementation process of the input prompting method includes the following steps:
  • S1002 Get the input number of the input position and the input text in the input box.
  • N in the present embodiment is the cumulative number of times of updating the candidate sentence.
  • S1008 Calculate possible connected words of the preset corresponding candidate sentences with the highest probability of occurrence according to the candidate sentence and the above.
  • step S1010 Determine whether N is equal to the set maximum value, or whether all possible connective words of each candidate sentence have an end identifier. If yes, step S1012 is performed, and if one of the determinations is YES, step S1016 is performed.
  • the accumulation of updated candidate sentences is achieved by assigning N.
  • step S1014 the process returns to step S1008 to calculate the possible connected words of the updated candidate sentences in the updated candidate sentence set, and obtain the possible connected words of the preset updated candidate sentences with the highest probability of occurrence.
  • S1018 Calculate an appearance probability of each candidate sentence having an end identifier according to the foregoing, and select, as a candidate input, a preset candidate sentence having an end identifier with the highest probability of occurrence.
  • S1020 Display the candidate input in the corresponding position of the cursor in the input interface.
  • the user can intuitively view the candidate input and select the candidate input, which brings convenience to the user's input operation and improves the input efficiency of the user.
  • FIG. 11 is a block diagram showing the structure of an electronic device 111 of an embodiment.
  • the internal structure of the electronic device 111 may correspond to the structure as shown in FIG. 3, and each of the following modules may be implemented in whole or in part by software, hardware, or a combination thereof.
  • the electronic device 111 includes a data acquisition module 1102 , a candidate sentence processing module 1104 , a calculation module 1106 , a determination module 1108 , and a conjunction processing module 1112 .
  • the data obtaining module 1102 is configured to obtain an input text of the current input position in the input interface that is less than or equal to a preset number of current statements of the above and/or below, the current input position.
  • the candidate sentence processing module 1104 is configured to use the input text as a candidate sentence.
  • the calculating module 1106 is configured to calculate possible connected words of the preset corresponding candidate sentences with the highest probability of occurrence according to the candidate sentences and the above and/or the following, and calculate the determined by the connected word processing module according to the above and/or the following The probability of occurrence of the candidate sentence each having the end identifier, and the candidate sentence having the end identifier with the highest probability of occurrence as the candidate input.
  • the determining module 1108 is configured to determine whether an end condition of the candidate sentence update is reached.
  • the connective word processing module 1112 is configured to connect the possible connected words each having the end identifier to the corresponding candidate sentences when the judgment result of the determining module is YES, to obtain candidate sentences each having the ending acquaintance.
  • the initial candidate sentence is the input text of the current sentence, the possible connection words according to the input text of the current sentence and the input text of the current sentence calculated above and/or below, and the end condition of the candidate sentence update is not reached.
  • the candidate sentence is connected to the possible conjunction without the end identifier, the candidate sentence is updated, and the possible connective words of the candidate sentence are updated cyclically. Since the possible conjunctions are determined according to the above and/or below, the calculated possible conjunctions can provide contextual contextual candidate inputs taking into account the above and/or below input conditions. By determining the candidate input of a long sentence that conforms to the context, the user can increase the input efficiency without having to input a long sentence multiple times.
  • the electronic device further includes an update module 1110.
  • the determination result of the determination module is negative, the possible connection words that do not have the end identifier are respectively connected to the corresponding candidate sentences, and then the candidate sentences are updated.
  • the candidate input is calculated according to the possible connecting words of the candidate sentence, and the candidate sentence and the possible connecting word without the ending identifier are updated with the candidate sentence, the possible connecting words of the candidate sentence are cyclically calculated, and the possible connecting words are repeatedly used. Cyclical calculations may connect words, and can continuously increase the number of words to form candidate inputs for long sentences.
  • the update module 1110 includes an initial processing module 1111 and an update processing module 1112.
  • the initial processing module 1111 is configured to connect each possible connected word of each candidate sentence that does not have an end identifier to the corresponding candidate sentence to obtain a preliminary update candidate sentence.
  • the calculation module 1106 is configured to calculate the probability of occurrence of each preliminary update candidate sentence according to the above and/or the following.
  • the update processing module 1112 is configured to update the candidate sentence according to a preset preliminary update candidate sentence with the highest probability of occurrence.
  • the updated update can be ensured.
  • the candidate sentences are within a certain number, thereby increasing the calculation speed of possible connective words of the candidate sentences, and further improving the calculation speed of the candidate inputs.
  • the end condition of the candidate sentence update includes that all possible connective words of each candidate sentence have an end identifier.
  • the apparatus may further comprise: an accumulation module 1114 for accumulating the number of times the candidate sentence is updated.
  • the termination condition of the candidate sentence update includes: the number of times the update candidate sentence accumulated by the accumulation module reaches the set maximum value.
  • the calculation speed of the candidate input can be improved by limiting the number of times of the loop calculation within a certain number of times.
  • the data acquisition module 1102 is configured to obtain a language style parameter.
  • the calculating module 1106 calculates, according to the candidate sentence and the above and/or the following, the possible connected words of the preset corresponding candidate sentences with the highest probability of occurrence corresponding to the language style parameter.
  • the candidate input with the same language style parameter can be determined, and the obtained candidate input can be more conformed to the language habit of the user, and the personalized setting of the user's language style can be realized.
  • the means for determining the candidate input further includes a transmitting module 1116 for transmitting the candidate input to the terminal device corresponding to the input interface.
  • the method for determining the candidate input in the embodiment runs on the server. It can be understood that the server receives the current input position in the input interface sent by the terminal that is less than or equal to the preset number of the above and/or below, the current input in the above. The input text of the current statement where the position is located, and the candidate input is determined based on the obtained data. The determined candidate input is sent to the corresponding terminal device.
  • the candidate input is determined by the server by sending the input text of the current input position in the input interface that is less than or equal to a preset number of the current statement of the above and/or below, the current input position, to the server. It can solve the problem that the computing power of the local device is insufficient, and use the computing power of the server to quickly calculate the candidate input, and then send the calculated candidate input to the terminal device.
  • FIG. 13 is a block diagram showing the structure of an electronic device 131 of an embodiment.
  • the electronic device 131 includes a text acquisition module 1302 , a processing module 1304 , a probability calculation module 1306 , a determination module 1308 , a connection processing module 1312 , and a display module 1314 .
  • the text obtaining module 1302 is configured to obtain an input text of the current input position in the input interface that is less than or equal to a preset number of the current statement of the above and/or below, the current input position.
  • the processing module 1304 is configured to use the input text as a candidate sentence.
  • the probability calculation module 1306 is configured to calculate possible connected words of the preset corresponding candidate sentences with the highest probability of occurrence according to the candidate sentences and the above and/or the following, and calculate the connection processing module according to the above and/or the following The probability of occurrence of each candidate sentence with an ending identifier, and will The candidate with the end probability is the candidate with the highest probability.
  • the determining module 1308 is configured to determine whether an end condition of the candidate sentence update is reached.
  • the connection processing module 1312 is configured to, when the determination result of the determination module is YES, connect the possible connected words each having the end identifier to the corresponding candidate sentences, respectively, to obtain candidate sentences each having the end recognition.
  • the display module 1314 is configured to display the candidate input in a corresponding position where the cursor is located in the input interface.
  • the electronic device further includes: a candidate update module 1310, configured to: when the determination result of the determining module is negative, connect the possible connected words that do not have the ending identifier to the corresponding candidate sentences respectively, and then update the candidate sentence.
  • a candidate update module 1310 configured to: when the determination result of the determining module is negative, connect the possible connected words that do not have the ending identifier to the corresponding candidate sentences respectively, and then update the candidate sentence.
  • FIG. 8 An interface diagram for displaying candidate inputs on a terminal device according to an embodiment is shown in FIG. 8.
  • the user can intuitively view the candidate input and select the candidate input, which can bring convenience to the user's input operation and improve the input efficiency of the user.
  • the input prompting device further includes:
  • the obtaining module 1316 is configured to be in a chat environment when the input interface is in a set state and set an automatic reply when the status of the corresponding chat account is set, and obtain a candidate input with the highest probability of occurrence.
  • the message sending module 1318 is configured to input the candidate input with the highest probability of occurrence into the input box and send it.
  • the program can be stored in a non-volatile computer readable storage.
  • the program can be stored In a storage medium of a computer system, and executed by at least one processor in the computer system to implement a process comprising an embodiment of the methods as described above.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Physics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Operations Research (AREA)
  • Probability & Statistics with Applications (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Algebra (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Machine Translation (AREA)
  • Document Processing Apparatus (AREA)

Abstract

一种确定候选输入的方法包括:根据当前语句的输入文字以及上文和/或下文计算的当前语句的输入文字的可能连接词,当达到候选句子更新的结束条件时,将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子计算具有结束标识的候选句子的出现概率,并将出现概率最大的预设个具有结束标识的候选句子作为候选输入。

Description

确定候选输入的方法、输入提示方法和电子设备
本申请要求于2016年08月03日提交中国专利局,申请号为2016106303026,发明名称为“确定候选输入的方法和装置及输入提示方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及互联网技术领域,特别是涉及一种确定候选输入的方法、输入提示方法和电子设备。
背景技术
随着个人电脑和手机等智能终端设备的发展,越来越多的场合需要人们使用终端设备编辑文字,例如聊天、写报告等。
为了提高用户输入的效率,一些输入法根据用户输入的文字为用户提供候选输入,例如:当用户输入“你好”时,输入法为用户提供“吗”、“!”等候选输入供用户选择。输入法所提供的候选输入根据常用语句和用户的输入记录生成,通常为单字或短词,当用户需要输入较长的句子时,例如,用户需要输入“现在外面下雨了,记得带伞”,当用户输入“现在”时,输入法提供了候选选项供用户输入,但由于“现在外面”并不是一个常规的词语,候选选项不会出现“外面”这个选项,于是用户输入“外”字,根据用户输入的“外”字,输入法提供的候选选项会包含“面”字供用户选择,在用户选择“面”字后,如果用户之前有多次输入过“外面下雨”,输入法提供的候选选项就可能会有“下雨”的选项,并在用户选择“下雨”后,提供的候选选项中有标点符号“,”的选项,在用户选择“,”后,没有候选选项提供,用户输入“记得”,根据用户输入的“记得”,输入法提供的候选输入没有“带伞”的选项,用户用手输入“带伞”完成输入。
由此可见,用户使用传统的输入法输入较长句子时,需要多次输入并选择才能完成,导致输入效率低。
发明内容
根据本申请的各种实施例,提供一种确定候选输入的方法、输入提示方法和电子设备。
一种确定候选输入的方法,包括:
获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、所述上文中当前输入位置所在的当前语句的输入文字;
将所述输入文字作为候选句子;
根据所述候选句子以及所述上文和/或下文计算得到出现概率最大的预设个对应的所述候选句子的可能连接词;
当达到候选句子更新的结束条件时,将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子;
根据所述上文和/或下文分别计算各具有结束标识的候选句子的出现概率,并将出现概率最大的预设个具有结束标识的候选句子作为候选输入。
一种输入提示方法,包括:
获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、所述上文中当前输入位置所在的当前语句的输入文字;
将所述输入文字作为候选句子;
根据所述候选句子以及所述上文和/或下文计算得到出现概率最大的预设个对应的所述候选句子的可能连接词;
当达到候选句子更新的结束条件时,将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子;
根据所述上文和/或下文分别计算各具有结束标识的候选句子的出现概率,并将出现概率最大的预设个具有结束标识的候选句子作为候选输入;
将所述候选输入显示在所述输入界面中光标所在的对应位置。
一种电子设备,包括存储器和处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:
获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、所述上文中当前输入位置所在的当前语句的输入文字;
将所述输入文字作为候选句子;
根据所述候选句子以及所述上文和/或下文计算得到出现概率最大的预设个对应的所述候选句子的可能连接词;
当达到候选句子更新的结束条件时,将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子;
根据所述上文和/或下文分别计算各具有结束标识的候选句子的出现概率,并将出现概率最大的预设个具有结束标识的候选句子作为候选输入。
一种电子设备,包括存储器和处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:
获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、所述上文中当前输入位置所在的当前语句的输入文字;
将所述输入文字作为候选句子;
根据所述候选句子以及所述上文和/或下文计算得到出现概率最大的预设个对应的所述候选句子的可能连接词;
当达到候选句子更新的结束条件时,将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子;
根据所述上文和/或下文分别计算各具有结束标识的候选句子的出现概率,并将出现概率最大的预设个具有结束标识的候选句子作为候选输入;
将所述候选输入显示在所述输入界面中光标所在的对应位置。
本发明的一个或多个实施例的细节在下面的附图和描述中提出。本发明的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为一个实施例中确定候选输入的方法的应用环境示意图;
图2为又一个实施例中确定候选输入的方法的应用环境示意图;
图3为一个实施例中终端的内部结构示意图;
图4为一个实施例中确定候选输入的方法的流程图;
图5为一个实施例中更新候选句子的步骤的流程图;
图6为又一个实施例中确定候选输入的方法的流程图;
图7为一个实施例中输入提示方法的流程图;
图8为一个实施例中在输入界面显示候选输入的界面示意图;
图9为一个实施例中根据候选输入自动回复的界面示意图;
图10为再一个实施例中输入提示方法的流程图;
图11为一个实施例中电子设备的结构框图;
图12为又一个实施例中电子设备的结构框图;
图13为另一个实施例中电子设备的结构框图;
图14为又一个实施例中电子设备的结构框图。
具体实施方式
为使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步的详细说明。应当理解,此处所描述的具体实施方式仅仅用以解释本发明,并不限定本发明的保护范围。
图1为一个实施例中确定候选输入的方法的应用环境示意图。如图1所示,该应用环境包括第一终端110、服务器120和第二终端130。第一终端110和第二终端130与服务器120通过网络进行通信。第一用户登录第一终端110上的应 用程序客户端与在第二终端130上登录的第二用户聊天。当终端或服务器获取到第一用户在当前输入位置预设数量的上文和输入框的输入文字时,根据输入框的输入文字和上文确定候选输入。
图2为另一个实施例中确定候选输入的方法的应用环境示意图。如图2所示,包括第一终端210和服务器220。第一用户在第一终端210上进行文字输入,例如,进行文本编辑。当终端或服务器获取到第一用户在当前输入位置预设数量的上文和/或下文和当前输入位置所在的当前语句的输入文字时,根据输入框的输入文字、上文和/或下文确定候选输入。若候选输入在服务器220上确定,则在确定候选输入后,服务器220将确定的候选输入发送至第一终端210。另一个实施例中确定候选输入的方法的应用环境可仅包括第一终端。例如,在文本编辑时,当终端获取到用户在当前输入位置预设数量的上文和/或下文和当前输入位置所在的当前语句的输入文字时,根据输入框的输入文字、上文和/或下文确定候选输入。
图3为一个实施例中终端的内部结构示意图。如图3所示,该终端包括通过系统总线连接的处理器、非易失性存储介质、显示屏、内存储器、网络接口和输入设备。其中,终端的存储介质存储有操作系统,还存储有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器实现一种确定候选输入方法。该处理器用于提供计算和控制能力,支撑整个终端的运行。终端中的内存储器为非易失性存储介质中的操作系统和计算机可执行指令提供高速缓存的运行环境。网络接口用于与服务器进行网络通信,如用户输入的文字发送到至服务器,接收服务器返回的聊天对象发送的输入文字等,输入设备用于接受用户的输入。终端的显示屏可以是液晶显示屏或者电子墨水显示屏等。输入设备可以是显示屏上覆盖的触摸层,也可以是终端外壳上设置的按键、轨迹球或触控板,也可以是外接的键盘、触控板或鼠标等。该终端可以是手机、平板电脑或者个人数字助理或穿戴式设备等。本领域技术人员可以理解,图3中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的终端的限定,具体的终端可以包括比 图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
图4为一个实施例中确定候选输入的方法的流程图。如图4所示,一种确定候选输入的方法,该确定候选输入的方法运行于如图1所示的第一终端110或第二终端130上,或者如图2所示的第一终端210上。该实施例中的方法包括以下步骤:
S402:获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、上文中当前输入位置所在的当前语句的输入文字。
具体地,当前输入位置是指光标所在的位置。光标所在位置的上下文包括以下几种情况:光标所在的位置有上文和下文的情况,例如,文本编辑的环境中,此时,获取当前输入位置的预设数量的上文和下文。光标所在的位置仅有上文的情况,例如,聊天环境中,此时,获取当前输入位置的预设数量的上文。光标所在位置仅有下文的情况,例如,文本编辑的环境中,此时,获取当前输入位置的预设数量的下文。上文的预设数量和下文的预设数量可以相同或不同,可根据具体情况由用户或开发人员设定。
在不同的应用环境中,采用不同的方法确定上文中当前输入位置所在的当前语句的输入文字。在非聊天环境中,例如,文本编辑的环境,可根据光标所在位置的上文中的标点符号确定。又例如,在文本编辑的环境中,当使用中文输入时,以“。”、“?”或“!”等区分每一句话。在上文中,从最后一个字向前搜索对应的标点符号,对应的标点符号至上文结束的最后一个字为当前语句的输入文字。在聊天环境中,将输入框中所输入的文字作为上文中当前输入位置所在的当前语句的输入文字。
可以理解的是,可以存在当前语句的输入文字为空的情况,例如,非聊天环境中,上文的最后一个字以“。”、“?”或“!”等标点符号结尾,又例如在聊天环境中,输入框中没有输入文字。
S404:将输入文字作为候选句子。
在一个具体示例中,可以建立一个候选句子集合,输入文字作为候选句子集合中的元素,即本实施例中的候选句子。
S406:根据候选句子以及上文和/或下文计算得到出现概率最大的预设个对应的候选句子的可能连接词。
在一个具体示例中,可以预先利用不同的会话集或文档基于神经网络训练出语言模型。将候选句子集合中的候选句子输入到预先训练好的语言模型,计算出候选句子的可能连接词及可能连接词的出现概率,并选择出现概率最大的预设个候选句子的可能连接词。预设个的具体数量可由系统开发者或用户预设设定。
S408:判断是否达到候选句子更新的结束条件。若是,执行步骤S410。
语言模型在训练时,对于被训练的每一句话加入起始标识和结束标识。一种实施方式的起始标识和结束标识可以相同,例如都为<END>符号。可以理解的是,在将上文和/或下文、上文中当前输入位置所在的当前语句的输入文字输入到语言模型中时,也将对一句加入起始标识和结束标识。在利用语言模型计算可能连接词时,当可能连接词具有结束标识时,则认为该可能连接词为当前语句为当前语句的结束。
S410:将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子。
若达到候选句子更新的结束条件,则将各具有结束标识的可能连接词连接到对应的候选句子中得到具有结束标识的候选句子。可建立结果集合,将具有结束标识的候选句子放入到结果集合中,具有结束标识的候选句子作为结果集合的元素。可以理解的是,结果集合包括每次更新的候选句子及其具有结束标识的可能连接词。
S412:根据上文和/或下文分别计算各具有结束标识的候选句子的出现概率,并将出现概率最大的预设个具有结束标识的候选句子作为候选输入。
具体地,将结果集合中的所有具有结束标识的候选句子分别输入到预先训练好的语言模型,计算出具有结束标识的候选句子的出现概率,并选择出概率最大的预设个具有结束标识的候选句子作为候选输入。
上述的确定候选输入的方法,初始的候选句子为当前语句的输入文字, 根据当前语句的输入文字以及上文和/或下文计算的当前语句的输入文字的可能连接词,当达到候选句子更新的结束条件时,将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子,根据上文和/或下文分别计算各具有结束标识的候选句子的出现概率,并将出现概率最大的预设个具有结束标识的候选句子作为候选输入。由于可能连接词根据上文和/或下文确定,计算的可能连接词能够考虑到上文和/或下文的输入情况,提供符合上下文语境的候选输入。通过确定符合上下文语境的长句的候选输入,用户无需多次输入得到长句,能够提高输入效率。
在再一个实施例中,请继续参阅图4,若步骤S408的判断结果为否,执行步骤S409。
S409:将各不具有结束标识的可能连接词分别连接到对应的候选句子中后更新候选句子。
当未达到候选句子更新的结束条件时,将各不具有结束标识的可能连接词分别连接到对应的候选句子中更新候选句子。更新的候选句子由更新前的候选句子和不具有结束标识的可能连接词组成。在本实施例中,候选句子集合中每个候选句子的全部不具有结束标识的可能连接词连接至对应候选句子后得到更新的候选句子,更新后的各候选句子组成更新后的候选句子集合。
在步骤S409之后,返回执行步骤S406,计算更新的候选句子集中的更新的候选句子的可能连接词,得到出现概率最大的预设个更新的候选句子的可能连接词。
上述的确定候选输入的方法,由于候选输入是根据候选句子的可能连接词计算得到的,并且将候选句子及不具有结束标识的可能连接词更新候选句子,循环计算候选句子的可能连接词,通过多次的循环计算可能连接词,能够不断增加字的数量,形成长句的候选输入。
步骤S409将各不具有结束标识的可能连接词分别连接到对应的候选句子中后更新候选句子为更新候选句子的步骤,在另一个实施例中,如图5所示,更新候选句子的步骤包括:
S4091:将各候选句子的各不具有结束标识的可能连接词分别连接到对应的候选句子中得到初步更新候选句子。
S4092:根据上文和/或下文分别计算各初步更新候选句子的出现概率。
S4093:根据出现概率最大的预设个初步更新候选句子更新候选句子。
可以理解的是,在可能连接词有多个的情况,对应的得到多个更新候选句子。由于在未达到候选句子更新的结束条件时,循环执行计算候选句子的可能连接词,因而,在一次更新的候选句子中,对于每一个更新的候选句子,可能得到多个不具有结束标识的可能连接词,从而得到多个更新的候选句子。在更新的候选句子较多时,计算量增大,导致候选输入计算缓慢。为提高计算速度,本实施例中,通过根据上文和/或下文分别计算各初步更新候选句子的出现概率,从中选出根据出现概率最大的预设个初步更新候选句子作为更新的候选句子,能够确保更新的候选句子在一定数量内,从而提高候选句子的可能连接词的计算速度,进一步的提高候选输入的计算速度。
在又一个实施例中,候选句子更新的结束条件可以包括:各候选句子的可能连接词全部具有结束标识。在该实施例中,若各候选句子的可能连接词全部具有结束结识(此时,候选句子集合的元素为空),则达到候选句子更新的结束条件,将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子。
在另一个实施例中,在步骤409的步骤之后,还可以包括:累计更新候选句子的次数。
具体地,累计更新候选句子的次数可通过计算迭代更新次数来实现,例如,在将输入文字作为候选句子的步骤之后,令N=0,N代表累计的更新候选句子的次数(即迭代更新次数),在各不具有结束标识的可能连接词分别连接到候选句子中后更新候选句子的步骤之后,令N=N+1,从而实现对更新候选句子的累计。
在该实施例中,候选句子更新的结束条件可以包括:更新候选句子的次数达到设定的最大值,从而,当更新候选句子的次数达到设定的最大值,即 上述的N等于设定的最大值时,则达到候选句子更新的结束条件,执行将各具有结束标识的可能连接词分别连接到候选句子中得到各具有结束结识的候选句子的步骤。
本实施例中,通过对更新句子的次数设定最大值,能够避免多次循环而导致候选输入的计算速度缓慢,通过将循环计算的次数限定的一定次数内,能够提高候选输入的计算速度。
在再一个实施例中,步骤S402可以包括:获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、上文中当前输入位置所在的当前语句的输入文字及语言风格参数。
语言风格是指输入文字的语言表达的格调。语言风格与用词习惯、专业领域和说话口吻相关。语言风格参数可预先在终端设备上对输入法应用进行设置。一种实施方式的语言风格参数包括用户习惯为网络流行语,说话口吻为俏皮。
在该实施例中,步骤S406具体可以为:根据候选句子以及上文和/或下文计算得到与语言风格参数对应的出现概率最大的预设个候选句子的可能连接词。从而得到的候选输入为对应语言风格的候选输入。
具体地,利用不同语言风格集训练得到不同的语言风格模型,将输入位置的小于或等于预设数量的上文和/或下文、上文中当前输入位置所在的当前语句的输入文字输入对应的语言风格的语言模型中,计算得到与语言风格参数对应的可能连接词。
本实施例中,通过设置语言风格参数能够确定与语言风格参数相同的候选输入,能够使得到的候选输入更贴合用户的语言习惯,实现对用户的语言风格的个性化设置。
在一个实施例中,语言模型基于神经网络利用多组对话和多个文档预先训练得到。以对话为例,一组对话为
Figure PCTCN2017094953-appb-000001
其中
Figure PCTCN2017094953-appb-000002
是第i组对话的第j句话。以文档为例,文档集中由多个文档{d1,d2,...,dn}组成。每篇文档都是以多个句子组成的,记作
Figure PCTCN2017094953-appb-000003
其中
Figure PCTCN2017094953-appb-000004
是第i个文档的第j句话。
以对话为例,以最大化给定数据集上的似然
Figure PCTCN2017094953-appb-000005
为目标,训练一个循环神经网络模型。训练之前,在每个人说的话的开始和后边分别接上一个起始标识<END>,分别代表一个人开始说一句话和一个人说完了一句话。其中
Figure PCTCN2017094953-appb-000006
代表给定第i个对话组前j句话
Figure PCTCN2017094953-appb-000007
时(不包括j),第j句话
Figure PCTCN2017094953-appb-000008
出现的概率。
Figure PCTCN2017094953-appb-000009
可以进一步写成
Figure PCTCN2017094953-appb-000010
其中,
Figure PCTCN2017094953-appb-000011
代表给定第i个对话组前j句话
Figure PCTCN2017094953-appb-000012
以及第j句话前k个词(不包括k)时,句子
Figure PCTCN2017094953-appb-000013
中第k个词出现的概率。
以文档为例,以最大化给定文档集上的似然
Figure PCTCN2017094953-appb-000014
为目标。其中
Figure PCTCN2017094953-appb-000015
代表给定第i个文档前j句话
Figure PCTCN2017094953-appb-000016
时(不包括j),第j句话
Figure PCTCN2017094953-appb-000017
出现的概率。
Figure PCTCN2017094953-appb-000018
可以进一步写成
Figure PCTCN2017094953-appb-000019
其中,
Figure PCTCN2017094953-appb-000020
代表给定第i个文档前j句话
Figure PCTCN2017094953-appb-000021
以及第j句话前k个词(不包括k)时,句子
Figure PCTCN2017094953-appb-000022
中第k个位置不同可能词出现的概率。
一种实施方式中,在聊天环境中利用语言模型确定候选输入的方法具体为,假设用户给出当前对话之前的j-1句话{a1,a2,...,aj-1},以及当前输入语句aj开头的z个词{aj1,aj2,...,ajz},利用语言模型计算使得
Figure PCTCN2017094953-appb-000023
最大的u个aj。一种实施方式中,在非聊天环境中利用语言模型确定候选输入的方法具体为,假设用户给出当前文档编辑位置之前的j-1句话{a1,a2,...,aj-1},当前文档编辑位置之后的l句话{aj+1,aj+2,...,aj+l},当前输入语句aj开头的z个词{aj1,aj2,...,ajz},利用语言模型计算
Figure PCTCN2017094953-appb-000024
最大的u个aj。其中,u是正整数,即出现概率最大的候选句子的可能连接词和概率最大的候选输入的数量。
具体地,将当前对话之前的j-1句话以及当前输入语句aj开头的z个词输入到语言模型中,或将当前文档编辑位置之前的j-1句话,当前文档编辑位置之后的l句话,当前输入语句aj开头的z个词输入到语言模型中,计算得到概率最大的u个当前输入语句aj开头的z个词可能连接词。在未达到候选句子更新的结束条件时,将各不具有结束标识的可能连接词分别连接在对应的候选句子中后更新候选句子,再将更新的候选句子分别输入到语言模型中,计算更新的 候选句子的可能连接词,直到更新候选句子的次数到达设定的最大值,或更新的各候选句子的可能连接词全部具有结束标识。将各具有结束标识的可能连接词分别连接到对应的候选句子中得到具有结束标识的候选句子,将具有结束标识的候选句子输入到语言模型,计算得到概率最大的u个具有结束标识的候选句子作为候选输入。
在一个实施例中,如上述的确定候选输入的方法,还可以运行于如图1所示的服务器120或如图2所示的服务器220上。在此情况下,如图6所示,在步骤S412之后,还可以包括:
S414:将候选输入发送至输入界面对应的终端设备。
本实施例的确定候选输入的方法运行于服务器上,可以理解的是,服务器接收终端发送的输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、上文中当前输入位置所在的当前语句的输入文字,根据获取的这些数据计算确定候选输入。并将确定的候选输入发送至对应的终端设备。
本实施例中,终端设备通过将输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、上文中当前输入位置所在的当前语句的输入文字发送给服务器,由服务器确定候选输入,能够解决本地设备计算能力不足的情况,利用服务器的计算能力,快速计算得到候选输入,再将计算的候选输入发送至终端设备。
在又一个实施例中,本发明实施例还提供一种输入提示方法,该输入提示方法运行于如图1所示的第一终端110或第二终端130上。如图7所示,该方法具体可以包括以下步骤:
S702:获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、上文中当前输入位置所在的当前语句的输入文字。
S704:将输入文字作为候选句子。
S706:根据候选句子以及上文和/或下文计算得到出现概率最大的预设个对应的候选句子的可能连接词。
S708:判断是否达到候选句子更新的结束条件。若是,执行步骤S710。
S710:将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子。
S712:根据上文和/或下文分别计算各具有结束标识的候选句子的出现概率,并将出现概率最大的预设个具有结束标识的候选句子作为候选输入。
上述各步骤的具体实现方法可以与上述确定候选输入的方法中的响应步骤的实现方式相同,在此不再赘述。
在另一个实施例中,请继续参阅图7,若步骤S708的判断结果为否则,执行步骤S709:将各不具有结束标识的可能连接词分别连接到对应的候选句子中后更新候选句子。
在步骤S709之后,返回执行步骤S706,计算更新的候选句子集中的更新的候选句子的可能连接词,得到出现概率最大的预设个更新的候选句子的可能连接词。
在步骤S712之后,执行步骤:
S714:将候选输入显示在输入界面中光标所在的对应位置。
一种具体示例中的在终端设备上显示候选输入的界面示意图如图8所示。本实施例中,通过将候选输入显示在输入显示中光标所在的对应位置,用户能够直观的查看候选输入,并选择候选输入,给用户的输入操作带来便捷,提高了用户的输入效率。
在又一实施例中,在步骤S714之后,还包括以下步骤:
若输入界面处于聊天环境,当对应聊天账号的状态为设定状态且设置自动回复时,获取出现概率最大的候选输入;将出现概率最大的候选输入输入到输入框中并发送。
设定状态可以包括离开状态、忙碌状态或请勿打扰等状态。在即时通讯等聊天工具中,用户可对处于离开状态、忙碌状态或请勿打扰状态时是否需要自动回复进行设置。当处于以上状态、且设置了需要进行自动回复时,接收到聊天好友发送的消息后,自动回复聊天好友。现有的自动回复的消息通常为用户在设置自动回复时已经设置好的回复消息,例如,“我吃饭去了,一 会再联系”。采用本实施例的方法,当检测到聊天账号处于以上状态且设置了需要自动回复时,获取与对方的聊天记录,根据聊天记录计算候选输入,并将概率最大的候选输入输入至输入框中发送,实现自动与对方聊天。且候选输入是站在用户的角度,根据聊天记录确定的,符合当前聊天的语境。一种实施方式的自动回复的界面示意图如图9所示。
本实施例以聊天环境为例,如图10所示,一种具体的输入提示方法的实现过程,包括以下步骤:
S1002:获取输入位置预设数量的上文以及输入框中的输入文字。
S1004:将输入文字作为候选句子。
S1006:令N=0。
本实施例中的N为累计的更新候选句子的次数。
S1008:根据候选句子以及上文计算得到出现概率最大的预设个对应的候选句子的可能连接词。
S1010:判断N是否等于设定的最大值,或各候选句子的可能连接词全部是否具有结束标识。若均为否,执行步骤S1012,若其中一个判定结果为是,执行步骤S1016。
S1012:将各不具有结束标识的可能连接词分别连接到对应的候选句子中后更新候选句子。
S1014:令N=N+1。
通过对N进行赋值实现对更新候选句子的累计。
在步骤S1014之后,返回执行步骤S1008,计算更新的候选句子集中的更新的候选句子的可能连接词,得到出现概率最大的预设个更新的候选句子的可能连接词。
S1016:将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子。
S1018:根据上文分别计算各具有结束标识的候选句子的出现概率,并将出现概率最大的预设个具有结束标识的候选句子作为候选输入。
S1020:将候选输入显示在输入界面中光标所在的对应位置。
该实施例中,用户能够直观的查看候选输入,并选择候选输入,给用户的输入操作带来便捷,提高了用户的输入效率。
图11为一个实施例的电子设备111的结构框图。电子设备111的内部结构可对应如图3所示的结构,下述每个模块可全部或部分通过软件、硬件或其组合来实现。如图11所示,电子设备111包括:数据获取模块1102、候选句子处理模块1104、计算模块1106、判断模块1108及连接词处理模块1112。
数据获取模块1102,用于获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、上文中当前输入位置所在的当前语句的输入文字。
候选句子处理模块1104,用于将输入文字作为候选句子。
计算模块1106,用于根据候选句子以及上文和/或下文计算得到出现概率最大的预设个对应的候选句子的可能连接词并根据上文和/或下文,分别计算连接词处理模块确定的各具有结束标识的候选句子的出现概率,并将出现概率最大的预设个具有结束标识的候选句子作为候选输入。
判断模块1108,用于判断是否达到候选句子更新的结束条件。
连接词处理模块1112,用于在判断模块的判断结果为是时,将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子。
上述的电子设备,初始的候选句子为当前语句的输入文字,根据当前语句的输入文字以及上文和/或下文计算的当前语句的输入文字的可能连接词,并且未达到候选句子更新的结束条件时,将候选句子连接不具有结束标识的可能连接词后更新候选句子,循环计算更新候选句子的可能连接词。由于可能连接词根据上文和/或下文确定,计算的可能连接词能够考虑到上文和/或下文的输入情况,提供符合上下文语境的候选输入。通过确定符合上下文语境的长句的候选输入,用户无需多次输入得到长句,能够提高输入效率。
在另一个实施例中,请继续参阅图11,电子设备还包括更新模块1110, 用于在判断模块的判断结果为否时,将各不具有结束标识的可能连接词分别连接到对应的候选句子中后更新候选句子。
上述的电子设备,由于候选输入是根据候选句子的可能连接词计算得到的,并且将候选句子及不具有结束标识的可能连接词更新候选句子,循环计算候选句子的可能连接词,通过多次的循环计算可能连接词,能够不断增加字的数量,形成长句的候选输入。
在另一个实施例中,如图12所示,更新模块1110包括:初处理模块1111和更新处理模块1112。
初处理模块1111,用于将各候选句子的各不具有结束标识的可能连接词分别连接到对应的候选句子中得到初步更新候选句子。
计算模块1106,用于根据上文和/或下文分别计算各初步更新候选句子的出现概率。
更新处理模块1112,用于根据出现概率最大的预设个初步更新候选句子更新候选句子。
本实施例中,通过将根据上文和/或下文分别计算各初步更新候选句子的出现概率,从中选出根据出现概率最大的预设个初步更新候选句子作为更新的候选句子,能够确保更新的候选句子在一定数量内,从而提高候选句子的可能连接词的计算速度,进一步的提高候选输入的计算速度。
在又一个实施例中,候选句子更新的结束条件包括:各候选句子的可能连接词全部具有结束标识。
在一个实施例中装置还可以包括:累计模块1114,用于累计更新候选句子的次数。
候选句子更新的结束条件包括:累计模块累计的更新候选句子的次数达到设定的最大值。
本实施例中,通过对更新句子的次数设定最大值,能够避免多次循环而导致候选输入的计算速度缓慢,通过将循环计算的次数限定的一定次数内,能够提高候选输入的计算速度。
在再一个实施例中,数据获取模块1102,用于获取语言风格参数。
计算模块1106,根据候选句子以及上文和/或下文计算得到与语言风格参数对应的出现概率最大的预设个对应的候选句子的可能连接词。
本实施例中,通过设置语言风格参数能够确定与语言风格参数相同的候选输入,能够使得到的候选输入更贴合用户的语言习惯,实现对用户的语言风格的个性化设置。
在又一个实施例中,确定候选输入的装置还包括发送模块1116,用于将候选输入发送至输入界面对应的终端设备。
本实施例的确定候选输入的方法运行于服务器上,可以理解的是,服务器接收终端发送的输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、上文中当前输入位置所在的当前语句的输入文字,根据获取的这些数据计算确定候选输入。并将确定的候选输入发送至对应的终端设备。
本实施例中,通过将输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、上文中当前输入位置所在的当前语句的输入文字发送给服务器,由服务器确定候选输入,能够解决本地设备计算能力不足的情况,利用服务器的计算能力,快速计算得到候选输入,再将计算的候选输入发送至终端设备。
图13为一个实施例的电子设备131的结构框图。如图13所示,电子设备131包括:文字获取模块1302、处理模块1304、概率计算模块1306、判断模块1308、连接处理模块1312和显示模块1314。
文字获取模块1302,用于获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、上文中当前输入位置所在的当前语句的输入文字。
处理模块1304,用于将输入文字作为候选句子。
概率计算模块1306,用于根据候选句子以及上文和/或下文计算得到出现概率最大的预设个对应的候选句子的可能连接词,并根据上文和/或下文,分别计算连接处理模块确定的各具有结束标识的候选句子的出现概率,并将出 现概率最大的预设个具有结束标识的候选句子作为候选输入。
判断模块1308,用于判断是否达到候选句子更新的结束条件。
连接处理模块1312,用于在判断模块的判断结果为是时,将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子。
显示模块1314,用于将候选输入显示在输入界面中光标所在的对应位置。
在另一个实施例中,请继续参阅图13。电子设备还包括:候选更新模块1310,用于在判断模块的判断结果为否时,将各不具有结束标识的可能连接词分别连接到对应的候选句子中后更新候选句子。
一种实施方式的在终端设备上显示候选输入的界面示意图如图8所示。本实施例中,通过将候选输入显示在输入显示中光标所在的对应位置,用户能够直观的查看候选输入,并选择候选输入,能用户的输入操作带来便捷,提高了用户的输入效率。
在再一个实施例中,输入提示装置还包括:
获取模块1316,用于在输入界面处于聊天环境,当对应聊天账号的状态为设定状态且设置自动回复时,获取出现概率最大的候选输入。
消息发送模块1318,用于将出现概率最大的候选输入输入到输入框中并发送。
采用本实施例的电子设备,当检测到聊天账号处于以上状态且设置自动回复时,获取与对方的聊天记录,根据聊天记录计算候选输入,并将概率最大的候选输入输入对输入框中发送,实现自动与对方聊天。且候选输入站在用户的角度,根据聊天记录确定的,符合当前聊天的语境。一种实施方式的自动回复的界面示意图如图9所示。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性的计算机可读取存储介质中,如本发明实施例中,该程序可存储 于计算机系统的存储介质中,并被该计算机系统中的至少一个处理器执行,以实现包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种确定候选输入的方法,包括:
    获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、所述上文中当前输入位置所在的当前语句的输入文字;
    将所述输入文字作为候选句子;
    根据所述候选句子以及所述上文和/或下文计算得到出现概率最大的预设个对应的所述候选句子的可能连接词;
    当达到候选句子更新的结束条件时,将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子;及
    根据所述上文和/或下文分别计算各具有结束标识的候选句子的出现概率,并将出现概率最大的预设个具有结束标识的候选句子作为候选输入。
  2. 根据权利要求1所述的方法,其特征在于,当未达到候选句子更新的结束条件时,将各不具有结束标识的可能连接词分别连接到对应的所述候选句子中后更新所述候选句子,并返回所述根据所述候选句子以及所述上文和/或下文计算得到出现概率最大的预设个对应的所述候选句子的可能连接词的步骤。
  3. 根据权利要求2所述的方法,其特征在于,所述将各不具有结束标识的可能连接词分别连接到对应的所述候选句子中后更新所述候选句子的步骤包括:
    将各候选句子的各不具有结束标识的可能连接词分别连接到对应的所述候选句子中得到初步更新候选句子;
    根据所述上文和/或下文分别计算各所述初步更新候选句子的出现概率;
    根据出现概率最大的预设个初步更新候选句子更新所述候选句子。
  4. 根据权利要求1所述的方法,其特征在于:
    所述候选句子更新的结束条件包括:各候选句子的可能连接词全部具有结束标识。
  5. 根据权利要求1或4所述的方法,其特征在于:在所述将各具有结束 标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子的步骤之后,还包括:累计更新候选句子的次数;
    所述候选句子更新的结束条件包括:更新所述候选句子的次数达到设定的最大值。
  6. 根据权利要求1所述的方法,其特征在于,所述获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、所述上文中当前输入位置所在的当前语句的输入文字的步骤包括:获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、所述上文中当前输入位置所在的当前语句的输入文字及语言风格参数;
    所述根据所述候选句子以及所述上文和/或下文计算得到出现概率最大的预设个对应的所述候选句子的可能连接词的步骤包括:
    根据所述候选句子以及所述上文和/或下文计算得到与所述语言风格参数对应的出现概率最大的预设个对应的所述候选句子的可能连接词。
  7. 根据权利要求1所述的方法,其特征在于,在所述根据所述上文和/或下文分别计算各具有结束标识的候选句子的出现概率,并将出现概率最大的预设个具有结束标识的候选句子作为候选输入的步骤之后,还包括:
    将所述候选输入发送至所述输入界面对应的终端设备。
  8. 一种输入提示方法,包括:
    获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、所述上文中当前输入位置所在的当前语句的输入文字;
    将所述输入文字作为候选句子;
    根据所述候选句子以及所述上文和/或下文计算得到出现概率最大的预设个对应的所述候选句子的可能连接词;
    当达到候选句子更新的结束条件时,将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子;
    根据所述上文和/或下文分别计算各具有结束标识的候选句子的出现概率,并将出现概率最大的预设个具有结束标识的候选句子作为候选输入;
    将所述候选输入显示在所述输入界面中光标所在的对应位置。
  9. 根据权利要求8所述的方法,其特征在于,当未达到候选句子更新的结束条件时,将各不具有结束标识的可能连接词分别连接到对应的所述候选句子中后更新所述候选句子,并返回所述根据所述候选句子以及所述上文和/或下文计算得到出现概率最大的预设个对应的所述候选句子的可能连接词的步骤。
  10. 根据权利要求8所述的方法,其特征在于,在所述将所述候选输入显示在所述输入界面中光标所在的对应位置的步骤之后,包括:
    若所述输入界面处于聊天环境,当对应聊天账号的状态为设定状态且设置自动回复时,获取出现概率最大的所述候选输入;
    将所述出现概率最大的所述候选输入输入到输入框中并发送。
  11. 一种电子设备,包括存储器和处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:
    获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、所述上文中当前输入位置所在的当前语句的输入文字;
    将所述输入文字作为候选句子;
    根据所述候选句子以及所述上文和/或下文计算得到出现概率最大的预设个对应的所述候选句子的可能连接词;
    当达到候选句子更新的结束条件时,将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子;
    根据所述上文和/或下文分别计算各具有结束标识的候选句子的出现概率,并将出现概率最大的预设个具有结束标识的候选句子作为候选输入。
  12. 根据权利要求11所述的电子设备,其特征在于,当未达到候选句子更新的结束条件时,将各不具有结束标识的可能连接词分别连接到对应的所述候选句子中后更新所述候选句子,并返回所述根据所述候选句子以及所述上文和/或下文计算得到出现概率最大的预设个对应的所述候选句子的可能 连接词的步骤。
  13. 根据权利要求12所述的电子设备,其特征在于,所述将各不具有结束标识的可能连接词分别连接到对应的所述候选句子中后更新所述候选句子的步骤包括:
    将各候选句子的各不具有结束标识的可能连接词分别连接到对应的所述候选句子中得到初步更新候选句子;
    根据所述上文和/或下文分别计算各所述初步更新候选句子的出现概率;
    根据出现概率最大的预设个初步更新候选句子更新所述候选句子。
  14. 根据权利要求11所述的电子设备,其特征在于:
    所述候选句子更新的结束条件包括:各候选句子的可能连接词全部具有结束标识。
  15. 根据权利要求11或14所述的电子设备,其特征在于:
    在所述将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子的步骤之后,所述计算机可读指令还使得所述处理器执行步骤:累计更新候选句子的次数;
    所述候选句子更新的结束条件包括:更新所述候选句子的次数达到设定的最大值。
  16. 根据权利要求11所述的电子设备,其特征在于,所述获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、所述上文中当前输入位置所在的当前语句的输入文字的步骤包括:获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、所述上文中当前输入位置所在的当前语句的输入文字及语言风格参数;
    所述根据所述候选句子以及所述上文和/或下文计算得到出现概率最大的预设个对应的所述候选句子的可能连接词的步骤包括:
    根据所述候选句子以及所述上文和/或下文计算得到与所述语言风格参数对应的出现概率最大的预设个对应的所述候选句子的可能连接词。
  17. 根据权利要求11所述的电子设备,其特征在于,在所述根据所述上 文和/或下文分别计算各具有结束标识的候选句子的出现概率,并将出现概率最大的预设个具有结束标识的候选句子作为候选输入的步骤之后,所述计算机可读指令还使得所述处理器执行步骤:
    将所述候选输入发送至所述输入界面对应的终端设备。
  18. 一种电子设备,包括存储器和处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:
    获取输入界面中的当前输入位置的小于或等于预设数量的上文和/或下文、所述上文中当前输入位置所在的当前语句的输入文字;
    将所述输入文字作为候选句子;
    根据所述候选句子以及所述上文和/或下文计算得到出现概率最大的预设个对应的所述候选句子的可能连接词;
    当达到候选句子更新的结束条件时,将各具有结束标识的可能连接词分别连接到对应的候选句子中得到各具有结束结识的候选句子;
    根据所述上文和/或下文分别计算各具有结束标识的候选句子的出现概率,并将出现概率最大的预设个具有结束标识的候选句子作为候选输入;
    将所述候选输入显示在所述输入界面中光标所在的对应位置。
  19. 根据权利要求18所述的电子设备,其特征在于,当未达到候选句子更新的结束条件时,将各不具有结束标识的可能连接词分别连接到对应的所述候选句子中后更新所述候选句子,并返回所述根据所述候选句子以及所述上文和/或下文计算得到出现概率最大的预设个对应的所述候选句子的可能连接词的步骤。
  20. 根据权利要求18所述的电子设备,其特征在于,在所述将所述候选输入显示在所述输入界面中光标所在的对应位置的步骤之后,所述计算机可读指令还使得所述处理器执行以下步骤:
    若所述输入界面处于聊天环境,当对应聊天账号的状态为设定状态且设置自动回复时,获取出现概率最大的所述候选输入;
    将所述出现概率最大的所述候选输入输入到输入框中并发送。
PCT/CN2017/094953 2016-08-03 2017-07-28 确定候选输入的方法、输入提示方法和电子设备 WO2018024166A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP17836348.7A EP3495928A4 (en) 2016-08-03 2017-07-28 METHOD FOR DETERMINING THE INPUT OF CANDIDATES, INPUT PROPOSAL METHOD AND ELECTRONIC DEVICE
US16/011,216 US11050685B2 (en) 2016-08-03 2018-06-18 Method for determining candidate input, input prompting method and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610630302.6 2016-08-03
CN201610630302.6A CN107688398B (zh) 2016-08-03 2016-08-03 确定候选输入的方法和装置及输入提示方法和装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/011,216 Continuation US11050685B2 (en) 2016-08-03 2018-06-18 Method for determining candidate input, input prompting method and electronic device

Publications (1)

Publication Number Publication Date
WO2018024166A1 true WO2018024166A1 (zh) 2018-02-08

Family

ID=61072748

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/094953 WO2018024166A1 (zh) 2016-08-03 2017-07-28 确定候选输入的方法、输入提示方法和电子设备

Country Status (4)

Country Link
US (1) US11050685B2 (zh)
EP (1) EP3495928A4 (zh)
CN (1) CN107688398B (zh)
WO (1) WO2018024166A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113703588A (zh) * 2020-05-20 2021-11-26 北京搜狗科技发展有限公司 一种输入方法、装置和用于输入的装置

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108075959B (zh) * 2016-11-14 2021-03-12 腾讯科技(深圳)有限公司 一种会话消息处理方法和装置
CN108897872B (zh) * 2018-06-29 2022-09-27 北京百度网讯科技有限公司 对话处理方法、装置、计算机设备和存储介质
CN109683727B (zh) * 2018-12-26 2021-07-16 联想(北京)有限公司 一种数据处理方法及装置
US11190911B2 (en) * 2019-07-11 2021-11-30 International Business Machines Corporation Automatic query-based communication system
CN110598222B (zh) * 2019-09-12 2023-05-30 北京金山数字娱乐科技有限公司 语言处理方法及装置、语言处理系统的训练方法及装置
CN110673748B (zh) * 2019-09-27 2023-04-28 北京百度网讯科技有限公司 输入法中候选长句的提供方法及装置
JP7419849B2 (ja) * 2020-02-06 2024-01-23 富士フイルムビジネスイノベーション株式会社 情報処理装置およびプログラム
CN113625885A (zh) * 2020-05-08 2021-11-09 北京搜狗科技发展有限公司 一种输入方法、装置和用于输入的装置
CN112000877A (zh) * 2020-07-15 2020-11-27 北京搜狗科技发展有限公司 一种数据处理方法、装置和介质
CN112684907B (zh) * 2020-12-24 2024-04-26 科大讯飞股份有限公司 一种文本输入方法、装置、设备及存储介质
US20220214801A1 (en) * 2021-01-06 2022-07-07 Typewise Ltd. Methods and systems for modifying user input processes
CN113361275A (zh) * 2021-08-10 2021-09-07 北京优幕科技有限责任公司 演讲稿逻辑结构评价方法和设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101833547A (zh) * 2009-03-09 2010-09-15 三星电子(中国)研发中心 基于个人语料库进行短语级预测输入的方法
US20140104175A1 (en) * 2012-10-16 2014-04-17 Google Inc. Feature-based autocorrection
CN103870449A (zh) * 2012-12-10 2014-06-18 百度国际科技(深圳)有限公司 在线自动挖掘新词的方法及电子装置
CN104298672A (zh) * 2013-07-16 2015-01-21 北京搜狗科技发展有限公司 一种输入的纠错方法和装置

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7657423B1 (en) * 2003-10-31 2010-02-02 Google Inc. Automatic completion of fragments of text
CN101008864A (zh) * 2006-01-28 2007-08-01 北京优耐数码科技有限公司 一种数字键盘多功能、多语种输入系统和方法
CN100458795C (zh) * 2007-02-13 2009-02-04 北京搜狗科技发展有限公司 一种智能组词输入的方法和一种输入法系统及其更新方法
CN101122901B (zh) * 2007-09-25 2011-11-09 腾讯科技(深圳)有限公司 中文整句生成方法及装置
GB201016385D0 (en) * 2010-09-29 2010-11-10 Touchtype Ltd System and method for inputting text into electronic devices
US10191654B2 (en) * 2009-03-30 2019-01-29 Touchtype Limited System and method for inputting text into electronic devices
KR101612788B1 (ko) * 2009-11-05 2016-04-18 엘지전자 주식회사 이동 단말기 및 그 제어 방법
WO2013007210A1 (zh) * 2011-07-14 2013-01-17 腾讯科技(深圳)有限公司 文字输入方法、装置及系统
JP5852930B2 (ja) * 2012-06-29 2016-02-03 Kddi株式会社 入力文字推定装置およびプログラム
WO2015183699A1 (en) * 2014-05-30 2015-12-03 Apple Inc. Predictive messaging method
US9842101B2 (en) * 2014-05-30 2017-12-12 Apple Inc. Predictive conversion of language input
CN104102720B (zh) * 2014-07-18 2018-04-13 上海触乐信息科技有限公司 高效输入的预测方法和装置
US9606988B2 (en) * 2014-11-04 2017-03-28 Xerox Corporation Predicting the quality of automatic translation of an entire document
US20170270092A1 (en) * 2014-11-25 2017-09-21 Nuance Communications, Inc. System and method for predictive text entry using n-gram language model
EP3483745A4 (en) * 2016-07-22 2019-07-10 Huawei Technologies Co., Ltd. METHOD AND TERMINAL DEVICE FOR PRESENTING A CANDIDATE ELEMENT

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101833547A (zh) * 2009-03-09 2010-09-15 三星电子(中国)研发中心 基于个人语料库进行短语级预测输入的方法
US20140104175A1 (en) * 2012-10-16 2014-04-17 Google Inc. Feature-based autocorrection
CN103870449A (zh) * 2012-12-10 2014-06-18 百度国际科技(深圳)有限公司 在线自动挖掘新词的方法及电子装置
CN104298672A (zh) * 2013-07-16 2015-01-21 北京搜狗科技发展有限公司 一种输入的纠错方法和装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113703588A (zh) * 2020-05-20 2021-11-26 北京搜狗科技发展有限公司 一种输入方法、装置和用于输入的装置

Also Published As

Publication number Publication date
EP3495928A4 (en) 2019-07-24
CN107688398B (zh) 2019-09-17
US11050685B2 (en) 2021-06-29
CN107688398A (zh) 2018-02-13
EP3495928A1 (en) 2019-06-12
US20180302350A1 (en) 2018-10-18

Similar Documents

Publication Publication Date Title
WO2018024166A1 (zh) 确定候选输入的方法、输入提示方法和电子设备
US11223584B2 (en) Automatic action responses
EP3423994B1 (en) Unified message search
US10007660B2 (en) Contextual language understanding for multi-turn language tasks
US9865264B2 (en) Selective speech recognition for chat and digital personal assistant systems
US11093711B2 (en) Entity-specific conversational artificial intelligence
US10521189B1 (en) Voice assistant with user data context
US11556548B2 (en) Intelligent query system for attachments
US9176944B1 (en) Selectively processing user input
US9721563B2 (en) Name recognition system
US20140349690A1 (en) Method and device for generating contact entry, and storage medium
CN105446994A (zh) 业务推荐方法和具有智能助手的装置
WO2015183699A1 (en) Predictive messaging method
JP2015528968A (ja) コンテキストを用いた文字列予測の生成
WO2013185109A2 (en) Systems and methods for recognizing textual identifiers within a plurality of words
CN110325987B (zh) 语境语音驱动深度书签
CN111312233A (zh) 一种语音数据的识别方法、装置及系统
CN108306813B (zh) 会话消息的处理方法、服务器及客户端
CN109286554B (zh) 社交应用中社交功能解锁方法及装置
CN109359298A (zh) 表情符推荐方法、系统及电子设备
CN116644159A (zh) 关键词提取方法、装置、设备及计算机可读存储介质
CN106202222A (zh) 热点事件的确定方法及装置
WO2022213943A1 (zh) 消息发送方法、消息发送装置、电子设备和存储介质
CN110249326B (zh) 自然语言内容生成器
CN117556061B (zh) 文本输出方法及装置、电子设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17836348

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2017836348

Country of ref document: EP

Effective date: 20190304