An input apparatus based on sample-probability quantization, wherein the apparatus comprises:
- an input module configured for acquiring a user-input information;
- a candidate-word module configured for, according to the user-input information, calculating to obtain candidate words;
- a sampling module configured for collecting and summarizing candidate-word sample data;
- a device-information module configured for acquiring a data-storage-space information of an electronic device;
- a parameter module configured for, according to the candidate-word sample data, and the data-storage-space information of the electronic device, calculating to obtain a sample-type quantity, a distribution width, a distribution center, a specified range of probability mapping values and a range boundary, and generating a mapping function, a condition mapping function and a quantization function;
- a probability predicting module configured for performing probability predicting calculation to the candidate words, to obtain probability values of the candidate words;
- and further configured for acquiring word classes corresponding to the candidate words, and under a condition of the word classes, performing probability predicting calculation to the candidate words, to obtain conditional-probability values of the candidate words;
- a probability-of-condition predicting module configured for performing probability predicting calculation to the word classes, to obtain probability-of-condition values of the word classes;
- a mapping module configured for inputting the probability values or the conditional-probability values of the candidate words into the mapping function, to obtain probability mapping values or conditional-probability mapping values corresponding to the candidate words, wherein the mapping function is configured for mapping the probability values or the conditional-probability values into a specified range of probability mapping values, and within the specified range, adjusting a statistical dispersion of the probability mapping values or the conditional-probability mapping values into an expectation, wherein the probability values and the probability mapping values are bijective, and the conditional-probability values and the conditional-probability mapping values are bijective;
- a condition mapping module configured for inputting the probability-of-condition values of the word classes into the condition mapping function, to obtain probability-of-condition mapping values corresponding to the word classes;
- a condition quantizing module configured for performing rounding processing to the probability-of-condition mapping values, to obtain quantized probability-of-condition mapping values;
- a quantizing module configured for performing rounding processing to the probability mapping values, to obtain quantized probability mapping values;
- and further configured for firstly performing accumulating calculation and then performing rounding processing to the probability-of-condition mapping values and the conditional-probability mapping values, or firstly performing rounding processing to the conditional-probability mapping values and then performing accumulating calculation with the quantized probability-of-condition mapping values, to obtain the quantized probability mapping values of the candidate words;
- and
- an output module configured for, according to the quantized probability mapping values, determining an order of the candidate words, to output a list of candidate words in order;
- wherein the mapping function comprises a piecewise mapping function defined by multiple sub-functions, wherein each of the sub-functions applies to a different interval in a domain of the mapping function, and the mapping module is configured for:
- determining an interval that the probability values of the candidate words fall within, to acquire a corresponding sub-function as a specific mapping function applies to the interval;
- and
- inputting the probability values of the candidate words into the specific mapping function, to obtain the probability mapping values corresponding to the candidate words, wherein the specific mapping function is configured for mapping the probability values on the interval into a specific range of the probability mapping values, wherein the specific range is a part of the whole range of the mapping function.