Input method, device and device for input
By determining the vector above of the user and searching the sentence corpus mapping relationship, providing sentence association candidates is solved, and the problem of insufficient integrity and coverage of sentence association candidates in the prior art is improved, and input efficiency and user experience are improved.
Patent Information
- Application Number
- CN202010365727.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-30
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2040-07-01
AI Technical Summary
Associative candidates for existing input methods are usually in units of words, resulting in insufficient integrity and coverage of sentence associations, which cannot effectively improve input efficiency and user experience.
By determining the vector corresponding to the user above and searching vectors based on the mapping relationship in the sentence corpus, sentence association candidates are provided, and the integrity and coverage of sentence association candidates are increased.
It improves the integrity and input efficiency of associative candidates, improves the user experience, and expands the coverage of sentence associative candidates through vector matching, which can provide a more convenient and intelligent input experience.
Smart Images

Figure CN113589945B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of input technology, and in particular to an input method, an input device and a device for input. Background Art
[0002] Input method refers to the encoding method used to input various texts into computers or other devices (such as mobile phones, tablets, etc.). If users want to input text into a device, they need to use an input method program. For example, users can enter keywords in a search engine to search the web, enter text in an instant messaging app (application) to communicate with other users, and enter text in a document app to edit a document, etc.
[0003] The associative function of the input method is an extended function of the input method program. Its appearance reduces the number of times the user actively inputs and the number of keystrokes, and increases the intelligence of the input method. At present, the input method program can provide corresponding associative candidates for the words that the user puts on the screen. For example, for the word "all over the sky" that the user puts on the screen, it provides associative candidates such as "heavy snow", "rolling on the ground", and "flying". For another example, for the word "birthday" that the user puts on the screen, it provides associative candidates such as "happy".
[0004] The inventors discovered during the implementation of the embodiments of the present invention that the user's expression is expressed in sentences, and association candidates are provided for words, resulting in poor completeness of the association candidates. Summary of the invention
[0005] The embodiments of the present invention provide an input method, a device and a device for input, which can improve the completeness of association candidates and the coverage of sentence association candidates.
[0006] In order to solve the above problem, an embodiment of the present invention discloses an input method, including:
[0007] Determine a first vector corresponding to the user's context;
[0008] According to the first vector, a search is performed in the mapping relationship between the second vector and the sentence association candidate to obtain the sentence association candidate corresponding to the first vector; the mapping relationship is obtained based on a sentence corpus, and the sentence corpus includes: a previous sample and a sentence association candidate, and the second vector corresponds to the previous sample.
[0009] On the other hand, an embodiment of the present invention discloses an input device, comprising:
[0010] A vector determination module, used to determine a first vector corresponding to the user's text;
[0011] A vector retrieval module is used to search, based on the first vector, in the mapping relationship between the second vector and the sentence association candidate to obtain the sentence association candidate corresponding to the first vector; the mapping relationship is obtained based on a sentence corpus, the sentence corpus includes: a previous sample and a sentence association candidate, and the second vector corresponds to the previous sample.
[0012] In another aspect, an embodiment of the present invention discloses a device for input, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the one or more programs include instructions for performing the following operations:
[0013] Determine a first vector corresponding to the user's context;
[0014] According to the first vector, a search is performed in the mapping relationship between the second vector and the sentence association candidate to obtain the sentence association candidate corresponding to the first vector; the mapping relationship is obtained based on a sentence corpus, and the sentence corpus includes: a previous sample and a sentence association candidate, and the second vector corresponds to the previous sample.
[0015] On the other hand, an embodiment of the present invention discloses a machine-readable medium having instructions stored thereon, which, when executed by one or more processors, causes a device to perform one or more of the input methods described above.
[0016] The embodiments of the present invention include the following advantages:
[0017] The embodiment of the present invention determines the sentence association candidate corresponding to the user's context based on the vector search for the corresponding mapping relationship of the sentence corpus. Since the language unit corresponding to the sentence association candidate is a sentence, the integrity of the association candidate can be improved, thereby improving input efficiency and enhancing user experience.
[0018] Furthermore, the embodiment of the present invention obtains sentence association candidates corresponding to the user's previous text based on vector retrieval, and can match the first vector with the second vector based on the distance between the first vector and the second vector in space. In this way, the first vector and the second vector are not required to be strictly consistent in terms of text, so the coverage of sentence association candidates can be increased.
[0019] For example, the sentence corpus includes: the above sample A "Can I talk to you?" and the sentence association candidate "I want to hear your voice". In the case that the user's above sample a is "Can I talk to you?", the embodiment of the present invention can determine that the first vector matches the second vector based on the distance between the first vector and the second vector in space, and then provide the corresponding sentence association candidate "I want to hear your voice". BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0021] Figure 1 is a schematic diagram of an application environment of an input method according to an embodiment of the present invention;
[0022] Figure 2 is a flow chart of steps of an input method embodiment of the present invention;
[0023] Figure 3 is a structural block diagram of an input device embodiment of the present invention;
[0024] Figure 4 is a block diagram of a device 800 for inputting according to the present invention; and
[0025] Figure 5 It is a schematic diagram of the structure of the server in some embodiments of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] An embodiment of the present invention provides an input scheme, which may include: determining a first vector corresponding to the user's previous text; based on the above first vector, searching in the mapping relationship between the second vector and the sentence association candidate to obtain the sentence association candidate corresponding to the above first vector; the above mapping relationship is obtained based on a sentence corpus, the above sentence corpus includes: previous text samples and sentence association candidates, and the above second vector corresponds to the above text sample.
[0028] The embodiment of the present invention obtains a mapping relationship between the second vector and the sentence association candidate based on the sentence corpus, and obtains the sentence association candidate corresponding to the user's previous context based on vector retrieval.
[0029] The embodiment of the present invention determines the sentence association candidate corresponding to the user's context based on the vector search for the corresponding mapping relationship of the sentence corpus. Since the language unit corresponding to the sentence association candidate is a sentence, the integrity of the association candidate can be improved, thereby improving input efficiency and enhancing user experience.
[0030] Furthermore, the embodiment of the present invention obtains sentence association candidates corresponding to the user's previous text based on vector retrieval, and can match the first vector with the second vector based on the distance between the first vector and the second vector in space. In this way, the first vector and the second vector are not required to be strictly consistent in terms of text, so the coverage of sentence association candidates can be increased.
[0031] For example, the sentence corpus includes: the above sample B1 "Can I talk to you?" and the sentence association candidate B1 "I want to hear your voice". Then, when the user's above context A is "Can I talk to you?", the embodiment of the present invention can determine that the first vector matches the second vector based on the distance between the first vector and the second vector in space, and then provide the corresponding sentence association candidate B1 "I want to hear your voice".
[0032] The embodiment of the present invention can achieve the continuity of sentence association. For example, the embodiment of the present invention can provide at least one sentence association candidate (such as sentence B1, sentence B2, etc.) for the user's previous context A; if the user selects sentence B2 to be displayed on the screen, at least one sentence association candidate (such as sentence C1, sentence C2, etc.) can also be provided for the user's previous context A and sentence B2; if the user selects sentence C1 to be displayed on the screen, at least one sentence association candidate (such as sentence D1, sentence D2, etc.) can also be provided for the user's previous context A, sentence B2, and sentence C1. It can be understood that in the case where the user continues to select sentence association candidates, the embodiment of the present invention can continue to provide corresponding sentence association candidates.
[0033] The input method provided by the embodiment of the present invention can be applied to Figure 1 In the application environment shown, Figure 1 As shown, the client 100 and the server 200 are located in a wired or wireless network, and the client 100 and the server 200 perform data exchange through the wired or wireless network.
[0034] Optionally, the client 100 can be run on a terminal, which specifically includes but is not limited to: a smart phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer, a car computer, a desktop computer, a set-top box, a smart TV, a wearable device, etc. The client 100 can correspond to a website or an APP (Application). The client 100 can correspond to an application such as an input method APP and an instant messaging APP.
[0035] The server of the embodiment of the present invention may be a cloud server. The cloud server is a simple, efficient, safe, reliable, and elastically scalable computing service. The resource information of the cloud server is dynamic, so that its processing capacity can be elastically scalable.
[0036] The embodiments of the present invention can be applied to input method programs of various input methods such as keyboard symbols, handwriting, and voice. Taking the keyboard symbol input method as an example, the user can input text through a coded string, and the input string can refer to the coded string input by the user. In the field of input methods, for input method programs such as Chinese, Japanese, Korean, or other languages, the input string input by the user can usually be converted into a candidate of the corresponding language. The following is mainly explained by taking Chinese as an example, and other languages such as Japanese and Korean can be referenced to each other. It can be understood that the above-mentioned Chinese input method can include but is not limited to full spelling, simplified spelling, strokes, Wubi, etc., and the embodiments of the present invention do not limit the specific input method program corresponding to a certain language.
[0037] Taking Chinese input as an example, the types of encoded character strings may include: Pinyin string, character string (such as Wubi string, etc.) Taking English input as an example, the types of encoded character strings may include: letter string, etc.
[0038] In actual applications, for the input method of keyboard symbols, the user can input the above input string through a physical keyboard or a virtual keyboard. For example, for a terminal with a touch screen, a virtual keyboard can be set in the input interface to input the input string by triggering the virtual keys included in the above virtual keyboard. Optionally, examples of the above virtual keyboard may include: a 9-key keyboard and a 26-key keyboard. In addition, it can be understood that in addition to the virtual keys corresponding to letters, the above input interface can also be provided with symbol keys, number keys, function keys such as Chinese-English switching keys, or toolbar keys, etc. It can be understood that the embodiment of the present invention does not limit the specific keys included in the input interface.
[0039] According to some embodiments, the input string may include, but is not limited to, a key symbol or a combination of multiple key symbols input by the user through keys. The key symbol may specifically include pinyin, strokes, kana, and the like.
[0040] In the embodiment of the present invention, the candidate may be used to represent one or more characters provided by the input method program to be selected by the user. The candidate may be characters in languages such as Chinese characters, English characters, and Japanese characters, and the candidate may also be a combination of symbols in the form of emoticons, pictures, and the like. The emoticons include but are not limited to pictures composed of lines, symbols, and words. For example, examples of the emoticons may include: “:P”, “:-o”, “:-)”, and the like.
[0041] Method Embodiment
[0042] Reference Figure 2 , shows a flow chart of steps of an input method embodiment of the present invention, which may specifically include the following steps:
[0043] Step 201: Determine the first vector corresponding to the user's text;
[0044] Step 202: Based on the first vector, a search is performed in the mapping relationship between the second vector and the sentence association candidate to obtain the sentence association candidate corresponding to the first vector; the mapping relationship may be obtained based on a sentence corpus, and the sentence corpus may include: a previous sample and a sentence association candidate, and the second vector corresponds to the previous sample.
[0045] Figure 2 The method embodiment shown may be executed by a client and / or a server. It is to be understood that the embodiment of the present invention does not limit the specific execution subject of the method embodiment.
[0046] According to an embodiment, the user context may be the portion before the input cursor. The user context may include: the most recent or most recent on-screen content. Of course, the user context may include: the clipboard content.
[0047] According to another embodiment, the user context may include: the communication content sent by the communication peer in the communication scenario. According to yet another embodiment, the context may include: the communication content sent to the communication peer in the communication scenario. It can be understood that the embodiment of the present invention does not limit the specific user context.
[0048] In an optional embodiment of the present invention, the end of the user text may include: preset punctuation marks. The preset punctuation marks may represent pauses in sentences, so that the user text corresponds to a language unit with high integrity.
[0049] The preset punctuation marks can be determined by technical personnel in this field according to actual application requirements. For example, the preset punctuation marks may include: comma ",", period ".", question mark "?", exclamation mark "!", period ".", space", etc. It can be understood that the embodiments of the present invention do not limit the specific preset punctuation marks.
[0050] For example, after user A inputs the content "everyone is busy" on the upper screen, he clicks the comma "," and then the input method of the embodiment of the present invention can be executed for the user's previous text "everyone is busy".
[0051] In another optional embodiment of the present invention, the user context may be a context sent by the user. The user context sent to the communication peer usually corresponds to a language unit with high integrity.
[0052] The embodiment of the present invention determines corresponding sentence association candidates for input content with higher integrity, which can improve the relevance between the sentence association candidates and the user's previous context, thereby improving input efficiency and enhancing user experience.
[0053] In the embodiment of the present invention, optionally, a text-to-vector conversion method may be used to determine a first vector corresponding to the user's text.
[0054] The above conversion method may include at least one of the following methods:
[0055] VSM (Vector Space Model) method;
[0056] word2vec (word to vector) method, etc.
[0057] It can be understood that the embodiment of the present invention does not limit the specific conversion method.
[0058] In the embodiment of the present invention, optionally, the determining the first vector corresponding to the user context includes:
[0059] Determine, according to the user context, a first vector corresponding to the user context; or
[0060] According to the user context and related information, a first vector corresponding to the user context is determined; the above related information includes: input environment characteristics and / or user characteristics.
[0061] In an optional embodiment of the present invention, the above-mentioned relevant information may include: user characteristics.
[0062] User characteristics may refer to characteristics possessed by a user. Optionally, user characteristics may include at least one of the following characteristics: preference characteristics and static characteristics.
[0063] Static features may be relatively stable features, such as the user's age, gender, region, education level, business district, occupation, marriage, consumption level, identity (such as father, mother, grandfather, grandmother, grandmother, grandfather, etc.), etc.
[0064] Compared with the relative stability of the above-mentioned static features, preference features are usually dynamic and can change with the ever-changing user behavior. In an optional embodiment of the present application, preference features can refer to user preference features for content. The preference features can change with the user's behavior on the content (at least one of input behavior, browsing behavior, search behavior, collection behavior, saving behavior, attention behavior, purchase behavior, sharing behavior, selection behavior and evaluation behavior).
[0065] The preference characteristics may include: language style characteristics. For example, the language style characteristics of the user may be determined based on the user's historical input data.
[0066] Language style features can be used to characterize the style of the language used by the user. Examples of language style features may include: humorous style, serious style, lively style, sweet style, etc. For example, if a user's input content contains a high proportion of humorous words, it can be considered that the user's language style features include "humorous style". For another example, if a user's input content contains a high proportion of serious words and the overall style tends to be serious, it can be considered that the user's language style features include "serious style". It can be understood that the embodiments of the present invention are not limited to specific user styles.
[0067] The embodiments of the present invention can provide different sentence association candidates according to different language style features, thereby improving the fit between the sentence association candidates and the input environment features, thereby improving the user experience.
[0068] Assuming that the user's previous text is "I went to sleep", when the language style feature is a lively style, the corresponding reply candidate may be "Don't sleep, get up and have fun"; when the language style feature is a serious style, the corresponding reply candidate may be "Good night".
[0069] In an optional embodiment of the present invention, the above-mentioned relevant information may include: input environment features. The input environment features can be used to characterize the environment information of the terminal when the user inputs. The input environment features can reflect the user's input intention to a certain extent. Therefore, by establishing a connection between the input environment features and the user's input intention, the user's input intention can be indirectly identified, thereby improving the user's input efficiency.
[0070] In practical applications, the input environment features may include various types of features. Optionally, the input environment features may include at least one of time environment features, location environment features, climate environment features, application environment features, and page environment features. Application environment features may include features such as the name of the application, the name of the installation package of the application, or the category of the application.
[0071] In the embodiment of the present invention, it is optional to preset a mapping relationship between application environment features and language style features. Specifically, different language style features can be determined for different application environment features. For example, the language style features corresponding to the chat environment features include: spoken style, and the language style features corresponding to the writing environment features include: written style, etc. For example, under the chat environment features, the sentence association candidate is "there will be strong winds tomorrow", while under the environment features of formally writing a press release, the sentence association candidate is "there will be three to four strong winds today and tomorrow."
[0072] In the case where the application environment feature is a communication environment feature, the above-mentioned input environment feature may further include: a peer user feature.
[0073] In an optional embodiment of the present invention, the above-mentioned counterpart user characteristics may include: registration information of the counterpart user on the communication platform, and / or, setting information of the local user characteristics for the above-mentioned counterpart user, and / or, evaluation information corresponding to the above-mentioned counterpart user.
[0074] In an embodiment of the present invention, when a user registers a user account on a communication platform, the user usually submits corresponding registration information, which may include nickname, age, region, etc. The embodiment of the present invention may obtain user characteristics based on the registration information.
[0075] The setting information of the user characteristics of the local end for the above-mentioned opposite end user may include: remark information, or group information, etc. The embodiment of the present invention can determine the user relationship based on the above-mentioned setting information, and apply the user relationship to the determination process of the sentence association candidate. For example, if the group information corresponding to the opposite end user is "family", then the user relationship is "family". For another example, if the remark information corresponding to the opposite end user is "wife", then the user relationship is "wife".
[0076] The evaluation information corresponding to the peer user may refer to the evaluation information of other users on the peer user, such as "talented woman", "intellectual beauty", "humorous master", etc. The embodiment of the present invention may determine the preference characteristics of the peer user based on the above evaluation characteristics.
[0077] The embodiment of the present invention can preset the mapping relationship between the opposite user characteristics and the language style characteristics. For example, the opposite user characteristics include: age, then when the age is over 60 years old, the language style characteristics are serious style. For another example, the opposite user characteristics include: user relationship, the user relationship is "wife", then the corresponding language style characteristics are sweet style; or, the user relationship is "colleague", then the corresponding language style characteristics are serious style; or, the user relationship is "child", then the corresponding language style characteristics are lively style, and so on. It can be understood that those skilled in the art can determine the mapping relationship between the opposite user characteristics and the language style characteristics according to the actual application requirements, and the embodiment of the present invention does not limit the mapping relationship between the opposite user characteristics and the language style characteristics.
[0078] In step 202, the sentence corpus may include: input corpus of an input method program, chat corpus of a communication platform, microblog corpus of a social platform, news corpus, or other Internet corpus.
[0079] The embodiment of the present invention obtains sentence association candidates corresponding to the user's previous context based on vector retrieval; it can match the first vector and the second vector based on the distance between the first vector and the second vector in space, and use the sentence association candidate corresponding to the second vector matching the first vector as the sentence association candidate corresponding to the user's previous context.
[0080] It should be noted that, in the embodiment of the present invention, the information type corresponding to the first vector matches the information type corresponding to the second vector. For example, if the first vector is generated based on the user's previous text, the second vector can also be obtained based on the previous text sample. For another example, if the first vector is generated based on the user's previous text and related information, the second vector can also be obtained based on the previous text sample and related information.
[0081] According to one embodiment, the first vector can be matched with all second vectors corresponding to all sentence corpora. Specifically, the spatial distance between the first vector and all second vectors can be calculated, and the second vector whose distance is less than the first distance threshold is used as the second vector that matches the first vector. The first distance threshold is used to characterize the threshold of the distance between the first vector and the second vector. The first distance threshold can be a relatively small value between 0 and 1. Those skilled in the art can determine the first distance threshold according to actual application requirements. The embodiment of the present invention does not limit the specific first distance threshold.
[0082] The measurement method of the distance between vectors may include: Euclidean distance, angle cosine, Hamming distance, or Jaccard similarity coefficient, etc. It can be understood that the embodiment of the present invention does not limit the specific measurement method of the distance between vectors.
[0083] According to another embodiment, the above-mentioned retrieval is performed in the mapping relationship between the second vector and the sentence association candidate, specifically including: determining the target index corresponding to the above-mentioned first vector based on the index of the above-mentioned first vector and the above-mentioned second vector; determining the sentence association candidate corresponding to the above-mentioned first vector based on the above-mentioned first vector and the second vector corresponding to the above-mentioned target index.
[0084] The embodiment of the present invention can pre-establish the index of the second vector; thus, in the vector search process, the target index corresponding to the first vector can be first determined, and then the first vector and the second vector corresponding to the target index can be matched. Since the matching operation of the second vector corresponding to the non-target index can be saved, the vector search efficiency can be improved.
[0085] Here, an example of establishing an index of a second vector is provided, which specifically includes: clustering a plurality of second vectors to obtain a plurality of vector categories; and establishing an index of the second vector within the vector category according to information of the vector category.
[0086] The information of the vector category may include: the center vector of the vector category. Accordingly, the above determination of the target index corresponding to the above first vector specifically includes: determining the target vector category corresponding to the above first vector based on the spatial distance between the above first vector and the center vector corresponding to the above vector category. Optionally, the vector category with a distance less than the second distance threshold can be used as the target vector category corresponding to the first vector, and the target vector category corresponds to the target index. The principle of the second distance threshold is similar to that of the first distance threshold, and will not be elaborated here, and can be referred to each other.
[0087] In the embodiment of the present invention, there may be one or more sentence association candidates corresponding to the user's previous text. Optionally, the multiple sentence association candidates may be sorted and displayed.
[0088] In the embodiment of the present invention, the display position of the sentence association candidate may be the position of the candidate area. Of course, the embodiment of the present invention does not limit the specific display position.
[0089] In an optional embodiment of the present invention, the client can send a sentence association request to the server, and the sentence association request can include: the user context, so that the server can use Figure 2 The method shown obtains sentence association candidates corresponding to the user's previous context.
[0090] Since the process of sending a sentence association request to the server, the server determining the sentence association candidate, and the server returning the sentence association candidate takes a certain amount of time; therefore, in order to alleviate the problem of the user waiting for the sentence association candidate, the above method may also include: if an input operation for a preset punctuation mark is detected, before displaying the sentence association candidate returned by the above server, the client displays the candidate corresponding to the preset punctuation mark in the candidate area. The processing of the candidate corresponding to the preset punctuation mark can alleviate the problem of the user waiting for the sentence association candidate to a certain extent.
[0091] It can be understood that after the user presets the candidate corresponding to the punctuation mark, the client can display the sentence association candidates returned by the server for the user to select on the screen.
[0092] In the embodiment of the present invention, the sentence association candidate may optionally include: input content and prediction result. For example, the sentence association candidate includes: input content "hoeing the field at noon" and prediction result "sweat dripping from the field".
[0093] The method may further include: displaying the input content in the sentence association candidate using a first display method; and displaying the prediction result in the sentence association candidate using a second display method.
[0094] The embodiment of the present invention distinguishes and displays the input content and the prediction results in the sentence association candidates, which can improve the distinction between the input content and the prediction results.
[0095] The display method of the embodiment of the present invention may include: color display, or superscript display, or text display, etc. For example, the colors of the input content and the predicted result are different, such as the input content is black and the predicted result is red. For another example, the input content does not have a superscript, but the predicted result has a superscript. Or, the font or font size of the input content and the predicted result is different, such as the font size of the predicted result is larger than the font size of the input content, etc.
[0096] In the embodiment of the present invention, the method may further include: caching sentence association candidates; acquiring target sentence association candidates matching the input string from the cache for the user's input string; and displaying the target sentence association candidates. The embodiment of the present invention caches the returned sentence association candidates for subsequent use.
[0097] Obtain target sentence association candidates that match the input string from the cache, and the corresponding matching condition may be: the code corresponding to the sentence association candidate in the cache includes: the code corresponding to the input string, in other words, the code corresponding to the input string is the full set or subset of the code corresponding to the sentence association candidate in the cache. For example, the sentence association candidate in the cache includes "Thank you for your help during this period of time". If the input string is "guoqu" or "zheduan", it can be considered that the input string matches the sentence association candidate; and if the input string is "zaizheli", it is considered that the input string does not match the sentence association candidate.
[0098] In the embodiment of the present invention, optionally, the number of characters corresponding to the input string can be greater than the character threshold, for example, the character threshold is 2, etc. That is, the input string and the sentence association candidate in the cache have at least 3 characters in common. Of course, the embodiment of the present invention does not limit the specific character threshold.
[0099] In the embodiment of the present invention, the input string can optionally match the beginning characters of the sentence association candidates in the cache. For example, the sentence association candidates in the cache include "Thank you for your help during this time", and the input string is "guoqu". In the embodiment of the present invention, the input string can optionally match the middle characters of the sentence association candidates in the cache.
[0100] In the embodiment of the present invention, optionally, the validity period of the cache may be at least one input cycle or a preset time length. An input cycle may be determined based on an input interval, or a punctuation mark, or a sending operation. For example, when the input interval exceeds an interval threshold, an input cycle may be considered to have ended. For another example, when a third preset punctuation mark (such as a period) is input, an input cycle may be considered to have ended. For another example, after the input content is sent to the communication peer, an input cycle may be considered to have ended.
[0101] In an optional embodiment of the present invention, the above method may also include: caching multiple sentence association candidates; in response to a user's on-screen operation on a first sentence association candidate, obtaining a second sentence association candidate matching the first sentence association candidate from the cache; and displaying the second sentence association candidate.
[0102] There may be multiple association candidates returned, and the multiple sentence association candidates differ in length or content.
[0103] For example, if the input content is "The moon shines brightly in front of the bed", the returned multiple sentence association candidates may include: "I wonder if it is frost on the ground", "I wonder if it is frost on the ground, I look up at the bright moon, I look down and think of my hometown", "Li Bai sleeps soundly", "Li Bai sleeps soundly, he looks up and hugs a beautiful woman, he looks down and dreams", etc. If the user puts the first sentence association candidate "Li Bai sleeps soundly" on the screen, the embodiment of the present invention can find the sentence association candidate "I look up and hug a beautiful woman, he looks down and dreams" that matches the first sentence association candidate from the cache, and provide "I look up and hug a beautiful woman" or "I look up and hug a beautiful woman, he looks down and dreams" as the second sentence association candidate to the user. Since the time and network resources consumed by sending sentence association requests can be saved, resources can be saved and input efficiency can be improved.
[0104] In summary, the input method of the embodiment of the present invention determines the sentence association candidate corresponding to the user's context based on the vector search for the corresponding mapping relationship of the sentence corpus. Since the language unit corresponding to the sentence association candidate is a sentence, the integrity of the association candidate can be improved, thereby improving the input efficiency and enhancing the user experience.
[0105] Furthermore, the embodiment of the present invention obtains sentence association candidates corresponding to the user's previous text based on vector retrieval, and can match the first vector with the second vector based on the distance between the first vector and the second vector in space. In this way, the first vector and the second vector are not required to be strictly consistent in terms of text, so the coverage of sentence association candidates can be increased.
[0106] For example, the sentence corpus includes: the above sample A "Can I have a voice chat with you?", sentence association candidate "I want to hear your voice", and sentence association candidate B "Want to hear your voice". In the case where the user's previous text a is "Can I have a voice chat with you?", the embodiment of the present invention can determine that the first vector matches the second vector based on the distance between the first vector and the second vector in space, and then provide the corresponding sentence association candidate A "I want to hear your voice", sentence association candidate B "Want to hear your voice", etc.
[0107] Moreover, based on the sentence corpus of big data, the embodiment of the present invention can provide sentence association candidates with higher relevance to the user's previous text, bringing a more convenient and intelligent input experience to the user.
[0108] The embodiment of the present invention can provide sentence association candidates for the following scenarios: a. When the user completes the input of a language unit and inputs a preset punctuation mark; b. After the user sends the input content in a communication scenario.
[0109] In the case where the embodiment of the present invention receives the user's input string, it can screen the candidates corresponding to the input string according to the sentence association candidates. For example, if the user's previous text a is "Can I have a voice chat with you?" and the input string is "xiangtignting", the candidates corresponding to the input string "xiangtignting" specifically include: "want to hear", "like Tingting", "towards Tingting", etc. Since "want to hear" matches the sentence association candidate, the sorting score of "want to hear" can be increased to place "want to hear" in a more prominent position.
[0110] In the case where the embodiment of the present invention receives the user's input string, it can screen the sentence association candidates according to the input string to obtain the target association candidate corresponding to the input string. For example, if the user's previous text a is "Can I have a voice chat with you?", it can screen the sentence association candidate A "I want to hear your voice" and sentence association candidate B "Want to hear your voice" according to the input string "xiangtignting", and use the obtained sentence association candidate B as the target association candidate.
[0111] The embodiment of the present invention screens the candidates corresponding to the input string according to the sentence association candidates, or screens the sentence association candidates according to the input string, specifically including: matching the input string with the sentence association candidates and performing screening operations according to the corresponding matching information.
[0112] Optionally, the input string matches the sentence association candidate, and the corresponding matching condition may be: the encoding corresponding to the sentence association candidate includes the encoding corresponding to the input string. In other words, the encoding corresponding to the input string is the complete set or subset of the encoding corresponding to the sentence association candidate. For example, the input string "xiangtignting" matches the sentence association candidate B "want to hear your voice", while the input string "woxiangni" does not match the sentence association candidate B "want to hear your voice".
[0113] In an embodiment of the present invention, optionally, the number of characters corresponding to the input string may be greater than the first threshold. For example, the first threshold is 2, etc. That is, there are at least 3 characters with the same code between the input string and the sentence association candidate. Of course, the specific first threshold in the embodiments of the present invention is not limited.
[0114] In an embodiment of the present invention, optionally, the input string may match the starting character of the sentence association candidate. Of course, the input string may match the middle character of the sentence association candidate.
[0115] It should be noted that for the method embodiments, for simplicity of description, they are all expressed as a series of combinations of movement actions. However, those skilled in the art should know that the embodiments of the present invention are not limited by the described action sequence, because according to the embodiments of the present invention, certain steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the movement actions involved are not necessarily essential for the embodiments of the present invention.
[0116] Device embodiment
[0117] Refer to Figure 3 , which shows a structural block diagram of an embodiment of an input device of the present invention, and may specifically include:
[0118] A vector determination module 301, configured to determine a first vector corresponding to the user's previous context;
[0119] A vector retrieval module 302, configured to retrieve in the mapping relationship between the second vector and the sentence association candidate according to the first vector to obtain the sentence association candidate corresponding to the first vector; the mapping relationship is obtained according to sentence corpus, and the sentence corpus includes: previous context samples and sentence association candidates, and the second vector corresponds to the previous context sample.
[0120] Optionally, the above vector retrieval module may include:
[0121] A target index determination module, configured to determine a target index corresponding to the first vector according to the index of the first vector and the second vector;
[0122] The vector matching module is used to determine the sentence association candidate corresponding to the first vector according to the first vector and the second vector corresponding to the target index.
[0123] Optionally, the above device may further include:
[0124] A vector clustering module, used for clustering the plurality of second vectors to obtain a plurality of vector categories;
[0125] The index establishment module is used to establish the index of the second vector in the above vector category according to the information of the above vector category.
[0126] Optionally, the vector determination module may include:
[0127] A first vector determining module is used to determine a first vector corresponding to the user context according to the user context; or
[0128] The second vector determination module is used to determine the first vector corresponding to the user context according to the user context and related information; the above related information may include: input environment characteristics and / or user characteristics.
[0129] Optionally, the above user characteristics may include: language style characteristics.
[0130] Optionally, the above-mentioned input environment characteristics may include: characteristics of the opposite end user in the instant messaging environment.
[0131] Optionally, the end of the above user text may include: a preset punctuation mark; or
[0132] The above user text is the text sent by the user.
[0133] Optionally, the sentence association candidates may include: input content and prediction results;
[0134] The above device may further include:
[0135] The first display module is used to display the input content in the above sentence association candidates using a first display method; and to display the prediction results in the above sentence association candidates using a second display method.
[0136] Optionally, the above device may further include:
[0137] A first cache module, used for caching sentence association candidates;
[0138] A first cache search module is used to obtain target sentence association candidates matching the input string from the cache according to the user's input string;
[0139] The second display module is used to display the above-mentioned target sentence association candidates.
[0140] Optionally, the above device may further include:
[0141] A second cache module is used to cache multiple sentence association candidates;
[0142] A second cache search module is used to obtain a second sentence association candidate matching the first sentence association candidate from the cache in response to a user's screen operation on the first sentence association candidate;
[0143] The third display module is used to display the association candidates of the second sentence.
[0144] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0145] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0146] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0147] An embodiment of the present invention provides a device for input, including a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations: determining a first vector corresponding to a user's previous context; based on the first vector, searching in a mapping relationship between a second vector and a sentence association candidate to obtain a sentence association candidate corresponding to the first vector; the mapping relationship is obtained based on a sentence corpus, the sentence corpus includes: a previous context sample and a sentence association candidate, and the second vector corresponds to the previous context sample.
[0148] Figure 4 8 is a block diagram of an input device 800 according to an exemplary embodiment. For example, the device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0149] Reference Figure 4 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0150] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0151] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, 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 disk or optical disk.
[0152] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0153] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the 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 input signals from the 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 boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0154] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a voice input mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0155] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0156] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0157] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can 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 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID, Radio Frequency Identification) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0158] In an exemplary embodiment, the apparatus 800 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, microcontrollers, microprocessors or other electronic components to perform the above method.
[0159] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0160] Figure 5 1 is a schematic diagram of the structure of the server in some embodiments of the present invention. The server 1900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1922 (for example, one or more processors) and memory 1932, and one or more storage media 1930 (for example, one or more mass storage devices) storing application programs 1942 or data 1944. Among them, the memory 1932 and the storage medium 1930 can be short-term storage or permanent storage. The program stored in the storage medium 1930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server. Furthermore, the central processing unit 1922 can be configured to communicate with the storage medium 1930 and execute a series of instruction operations in the storage medium 1930 on the server 1900.
[0161] The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input and output interfaces 1958, one or more keyboards 1956, and / or, one or more operating systems 1941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0162] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a device (server or terminal), enables the device to perform Figure 2 or Figure 3 Input method shown.
[0163] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a device (server or terminal), enables the device to execute an input method, the method comprising: determining a first vector corresponding to a user's previous context; based on the first vector, searching in a mapping relationship between a second vector and a sentence association candidate to obtain a sentence association candidate corresponding to the first vector; the mapping relationship is obtained based on a sentence corpus, the sentence corpus comprising: a previous context sample and a sentence association candidate, and the second vector corresponds to the previous context sample.
[0164] The embodiment of the present invention discloses A1, an input method, the method comprising:
[0165] Determine a first vector corresponding to the user's context;
[0166] According to the first vector, a search is performed in the mapping relationship between the second vector and the sentence association candidate to obtain the sentence association candidate corresponding to the first vector; the mapping relationship is obtained based on a sentence corpus, and the sentence corpus includes: a previous sample and a sentence association candidate, and the second vector corresponds to the previous sample.
[0167] A2. According to the method described in A1, searching in the mapping relationship between the second vector and the sentence association candidate includes:
[0168] Determining a target index corresponding to the first vector according to the indexes of the first vector and the second vector;
[0169] A sentence association candidate corresponding to the first vector is determined according to the first vector and a second vector corresponding to the target index.
[0170] A3. The method according to A2, further comprising:
[0171] Clustering the multiple second vectors to obtain multiple vector categories;
[0172] An index of a second vector in the vector category is established according to the information of the vector category.
[0173] A4. According to any one of the methods described in A1 to A3, determining the first vector corresponding to the user context includes:
[0174] Determine, according to the user context, a first vector corresponding to the user context; or
[0175] According to the user context and related information, a first vector corresponding to the user context is determined; the related information includes: input environment features and / or user features.
[0176] A5. According to the method described in A4, the user characteristics include: language style characteristics.
[0177] A6. According to the method described in A4, the input environment characteristics include: characteristics of the opposite user in the instant messaging environment.
[0178] A7. According to any one of the methods A1 to A3, the end of the user text includes: a preset punctuation mark; or
[0179] The user context is the context sent by the user.
[0180] A8. According to any one of the methods described in A1 to A3, the sentence association candidates include: input content and prediction results;
[0181] The method further comprises:
[0182] The input content in the sentence association candidate is displayed using a first display method; and the prediction result in the sentence association candidate is displayed using a second display method.
[0183] A9. The method according to any one of A1 to A3, further comprising:
[0184] Cache sentence association candidates;
[0185] For a user input string, obtaining a target sentence association candidate matching the input string from a cache;
[0186] The target sentence association candidates are displayed.
[0187] A10. The method according to any one of A1 to A3, further comprising:
[0188] Cache multiple sentence association candidates;
[0189] In response to a user's on-screen operation on a first sentence association candidate, obtaining a second sentence association candidate matching the first sentence association candidate from a cache;
[0190] The second sentence association candidates are displayed.
[0191] The embodiment of the present invention discloses B11, an input device, comprising:
[0192] A vector determination module, used to determine a first vector corresponding to the user's text;
[0193] A vector retrieval module is used to search, based on the first vector, in the mapping relationship between the second vector and the sentence association candidate to obtain the sentence association candidate corresponding to the first vector; the mapping relationship is obtained based on a sentence corpus, the sentence corpus includes: a previous sample and a sentence association candidate, and the second vector corresponds to the previous sample.
[0194] B12. According to the device described in B11, the vector search module includes:
[0195] a target index determination module, configured to determine a target index corresponding to the first vector according to the indexes of the first vector and the second vector;
[0196] A vector matching module is used to determine a sentence association candidate corresponding to the first vector based on the first vector and a second vector corresponding to the target index.
[0197] B13. The device according to B12, further comprising:
[0198] A vector clustering module, used for clustering the plurality of second vectors to obtain a plurality of vector categories;
[0199] The index establishing module is used to establish the index of the second vector in the vector category according to the information of the vector category.
[0200] B14. According to any one of B11 to B13, the vector determination module comprises:
[0201] A first vector determining module is used to determine a first vector corresponding to the user context according to the user context; or
[0202] The second vector determination module is used to determine the first vector corresponding to the user context according to the user context and related information; the related information includes: input environment characteristics and / or user characteristics.
[0203] B15. According to the device described in B14, the user characteristics include: language style characteristics.
[0204] B16. According to the device described in B14, the input environment characteristics include: characteristics of the opposite user in the instant messaging environment.
[0205] B17. According to any one of B11 to B13, the end of the user text includes: a preset punctuation mark; or
[0206] The user context is the context sent by the user.
[0207] B18. According to any one of B11 to B13, the sentence association candidates include: input content and prediction results;
[0208] Then the device also includes:
[0209] The first display module is used to display the input content in the sentence association candidate using a first display method; and to display the prediction result in the sentence association candidate using a second display method.
[0210] B19. The device according to any one of B11 to B13, further comprising:
[0211] A first cache module, used for caching sentence association candidates;
[0212] A first cache search module is used to obtain target sentence association candidates matching the input string from the cache according to the user's input string;
[0213] The second display module is used to display the target sentence association candidates.
[0214] B20. The device according to any one of B11 to B13, further comprising:
[0215] A second cache module is used to cache multiple sentence association candidates;
[0216] A second cache search module is used to obtain a second sentence association candidate matching the first sentence association candidate from the cache in response to a user's screen operation on the first sentence association candidate;
[0217] The third display module is used to display the second sentence association candidates.
[0218] The embodiment of the present invention discloses C21, a device for input, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations:
[0219] Determine a first vector corresponding to the user's context;
[0220] According to the first vector, a search is performed in the mapping relationship between the second vector and the sentence association candidate to obtain the sentence association candidate corresponding to the first vector; the mapping relationship is obtained based on a sentence corpus, and the sentence corpus includes: a previous sample and a sentence association candidate, and the second vector corresponds to the previous sample.
[0221] C22. The device according to C21, wherein searching in the mapping relationship between the second vector and the sentence association candidate comprises:
[0222] Determining a target index corresponding to the first vector according to the indexes of the first vector and the second vector;
[0223] A sentence association candidate corresponding to the first vector is determined according to the first vector and a second vector corresponding to the target index.
[0224] C23. The device according to C22, wherein the device is further configured to execute, by one or more processors, the one or more programs including instructions for performing the following operations:
[0225] Clustering the multiple second vectors to obtain multiple vector categories;
[0226] An index of a second vector in the vector category is established according to the information of the vector category.
[0227] C24. According to any one of C21 to C23, the determining of the first vector corresponding to the user context comprises:
[0228] Determine, according to the user context, a first vector corresponding to the user context; or
[0229] According to the user context and related information, a first vector corresponding to the user context is determined; the related information includes: input environment features and / or user features.
[0230] C25. According to the device described in C24, the user characteristics include: language style characteristics.
[0231] C26. According to the device described in C24, the input environment characteristics include: characteristics of the opposite user in the instant messaging environment.
[0232] C27. According to any one of C21 to C23, the end of the user text includes: a preset punctuation mark; or
[0233] The user context is the context sent by the user.
[0234] C28. According to any one of the apparatuses described in C21 to C23, the sentence association candidates include: input content and prediction results;
[0235] The device is further configured to execute, by one or more processors, the one or more programs including instructions for performing the following operations:
[0236] The input content in the sentence association candidate is displayed using a first display method; and the prediction result in the sentence association candidate is displayed using a second display method.
[0237] C29. The device according to any one of C21 to C23, wherein the device is further configured to execute, by one or more processors, the one or more programs including instructions for performing the following operations:
[0238] Cache sentence association candidates;
[0239] For a user input string, obtaining a target sentence association candidate matching the input string from a cache;
[0240] The target sentence association candidates are displayed.
[0241] C30. The device according to any one of C21 to C23, wherein the device is further configured to execute, by one or more processors, the one or more programs including instructions for performing the following operations:
[0242] Cache multiple sentence association candidates;
[0243] In response to a user's on-screen operation on a first sentence association candidate, obtaining a second sentence association candidate matching the first sentence association candidate from a cache;
[0244] The second sentence association candidates are displayed.
[0245] The embodiment of the present invention discloses D31, a machine-readable medium having instructions stored thereon, which, when executed by one or more processors, enables the device to execute the input method as described in one or more of A1 to A10.
[0246] Those skilled in the art will readily appreciate other embodiments of the invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0247] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
[0248] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
[0249] The above is a detailed introduction to an input method, an input device and a device for input provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. An input method, characterized in that: The method comprises: Determine a first vector corresponding to the user's context; According to the first vector, a search is performed in the mapping relationship between the second vector and the sentence association candidate to obtain the sentence association candidate corresponding to the first vector; the mapping relationship is obtained based on a sentence corpus, the sentence corpus includes: a previous sample and a sentence association candidate, and the second vector corresponds to the previous sample; the distance between the first vector and the matching second vector is less than a first distance threshold, and the first distance threshold is used to represent the threshold of the distance between the first vector and the second vector.
2. The method according to claim 1, characterized in that The searching in the mapping relationship between the second vector and the sentence association candidate includes: Determining a target index corresponding to the first vector according to the indexes of the first vector and the second vector; A sentence association candidate corresponding to the first vector is determined according to the first vector and a second vector corresponding to the target index.
3. The method according to claim 2, characterized in that The method further comprises: Clustering the multiple second vectors to obtain multiple vector categories; An index of a second vector in the vector category is established according to the information of the vector category.
4. The method according to any one of claims 1 to 3, characterized in that: The determining the first vector corresponding to the user context includes: Determine, according to the user context, a first vector corresponding to the user context; or According to the user context and related information, a first vector corresponding to the user context is determined; the related information includes: input environment features and / or user features.
5. The method according to claim 4, characterized in that The user characteristics include: language style characteristics.
6. The method according to claim 4, characterized in that The input environment characteristics include: characteristics of the opposite end user in the instant messaging environment.
7. The method according to any one of claims 1 to 3, characterized in that: The end of the user text includes: a preset punctuation mark; or The user context is the context sent by the user.
8. An input device, characterized in that: include: A vector determination module, used to determine a first vector corresponding to the user's text; A vector retrieval module, configured to search, based on the first vector, in a mapping relationship between a second vector and a sentence association candidate to obtain a sentence association candidate corresponding to the first vector; The mapping relationship is obtained based on sentence corpus, the sentence corpus includes: a previous sample and sentence association candidates, and the second vector corresponds to the previous sample; The distance between the first vector and the matching second vector is less than a first distance threshold, and the first distance threshold is used to represent a threshold of a distance between the first vector and the second vector that matches.
9. A device for input, characterized in that The system comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations: Determine a first vector corresponding to the user's context; According to the first vector, searching in the mapping relationship between the second vector and the sentence association candidate to obtain the sentence association candidate corresponding to the first vector; The mapping relationship is obtained based on sentence corpus, the sentence corpus includes: a previous sample and sentence association candidates, and the second vector corresponds to the previous sample; The distance between the first vector and the matching second vector is less than a first distance threshold, and the first distance threshold is used to represent a threshold of a distance between the first vector and the second vector that matches.
10. A machine-readable medium having instructions stored thereon, which, when executed by one or more processors, cause an apparatus to perform an input method as claimed in one or more of claims 1 to 7.
Citation Information
Patent Citations
Input method, input device and device for input
CN108803890A
Sentence association method and device
CN111381685A
Data processing method and device and device for data processing
CN113010768A
Input method and device and device for input
CN113589950A
Method and device for data processing and device for use in data processing
WO2020056948A1
