Word combination path determination method and device, electronic equipment and storage medium

By obtaining the first and second subsequences during the word grouping process and using intermediate state data to predict the word grouping path, the stuttering problem caused by the large computational load of deep learning models is solved, and the fluency of word grouping is improved.

CN120994075APending Publication Date: 2025-11-21BEIJING SOGOU TECHNOLOGY DEVELOPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410627220.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Deep learning models involve a large amount of computation during word formation, which can lead to stuttering and affect the fluency of word formation.

Method used

By obtaining the first and second subsequences in the target sequence, and using intermediate state data to predict word formation paths, the computational load is reduced and fluency is improved.

Benefits of technology

It reduces the risk of stuttering during word formation and improves the fluency of word formation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994075A_ABST
    Figure CN120994075A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a word combination path determination method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a current input target sequence, and determining a first subsequence, a second subsequence and a change syllable in the target sequence, determining an increment position based on a first sequence length of the first sub-sequence and a second sequence length of the second sub-sequence, determining the second sub-sequence and the first sub-sequence based on the increment position and the change syllable, and reading intermediate state data corresponding to the first sub-sequence, the target model is called to predict a third word node located behind the second word node based on the intermediate state data and the second word node, a word combination path of the target sequence is determined based on the first word node, the second word node and the third word node, and the intermediate state data are reused, so that the calculation amount of the target model during prediction of the third word node can be reduced, and the prediction efficiency of the target model is improved. The jamming risk in the word combination process is reduced, the word combination smoothness is improved, and the method can be widely applied to scenes such as an input method, artificial intelligence and a cloud technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for determining word formation paths. Background Technology

[0002] With the development of information technology, text input via input methods has become a very mature technology. In related technologies, when a user inputs text, a deep learning model typically determines the word-grouping path based on the target sequence of the user's input, thereby identifying candidate words. However, as the computational load of deep learning models increases, there is a risk of lag, leading to a decrease in the fluency of word grouping. Summary of the Invention

[0003] The following is an overview of the subject matter described in detail in this disclosure. This overview is not intended to limit the scope of the claims.

[0004] This disclosure provides a method, apparatus, electronic device, and storage medium for determining word formation paths, which can reduce the risk of stuttering during the word formation process and improve the fluency of word formation.

[0005] On the one hand, embodiments of this disclosure provide a method for determining word formation paths, including:

[0006] Obtain the target sequence of the current input, and determine a first subsequence and a second subsequence in the target sequence, wherein the second subsequence includes syllables located before and adjacent to the changed syllables, the changed syllables being the syllables in the target sequence that produce the input change, and the first subsequence includes all syllables located before the second subsequence;

[0007] Read the intermediate state data corresponding to the first sub-sequence, wherein the intermediate state data is output by the target model and pre-saved when the target model predicts the second word node of the second sub-sequence based on the first word node of the first sub-sequence;

[0008] The target model is invoked to predict the third character node located after the second character node based on the intermediate state data and the second character node, and the word formation path of the target sequence is determined based on the first character node, the second character node, and the third character node.

[0009] On the other hand, embodiments of this disclosure provide a word grouping path determination device, including:

[0010] A sequence determination module is used to obtain the target sequence of the current input, and determine a first subsequence and a second subsequence in the target sequence, wherein the second subsequence includes syllables located before and adjacent to the changed syllables, the changed syllables being syllables in the target sequence that produce input changes, and the first subsequence includes all syllables located before the second subsequence;

[0011] The data reading module is used to read the intermediate state data corresponding to the first sub-sequence, wherein the intermediate state data is output by the target model and pre-saved when the target model predicts the second word node of the second sub-sequence based on the first word node of the first sub-sequence;

[0012] The path determination module is used to call the target model to predict the third character node located after the second character node based on the intermediate state data and the second character node, and to determine the word formation path of the target sequence based on the first character node, the second character node and the third character node.

[0013] Furthermore, in determining the first subsequence and the second subsequence in the target sequence, the sequence determination module is also used for:

[0014] Determine the first sequence length of the altered syllables, and determine the second sequence length of the target sequence;

[0015] The incremental position is determined in the target sequence based on the difference between the length of the second sequence and the length of the first sequence, and the first subsequence and the second subsequence are determined in the target sequence based on the incremental position.

[0016] Furthermore, in determining the incremental position in the target sequence based on the difference between the second sequence length and the first sequence length, the sequence determination module is further configured to:

[0017] When the changed syllable is the last syllable in the target sequence, the difference between the length of the second sequence and the length of the first sequence is used as the incremental position in the target sequence;

[0018] Alternatively, when the changed syllable is any syllable in the target sequence other than the first and last syllables, the sum of the lengths of all syllable sequences following the changed syllable is determined to obtain a third sequence length. A fourth sequence length is obtained based on the sum of the first sequence length and the third sequence length. The incremental position in the target sequence is determined based on the difference between the second sequence length and the fourth sequence length.

[0019] Furthermore, when the altered syllable is the last syllable in the target sequence, the sequence determination module is further configured to: determine the first sequence length of the altered syllable.

[0020] In the target sequence, a first position that generates the input change is determined. When the first position is the last position in the target sequence, a second position is searched forward from the first position until the second position and the first position form the longest complete syllable, thus obtaining the changed syllable. The first sequence length of the changed syllable is determined based on the first position and the second position.

[0021] Alternatively, a first position in the target sequence that generates the input change is determined. When the first position is any position in the target sequence other than the first and last positions, a second position is searched forward from the first position until the second position and the last position in the target sequence form the longest complete syllable, thus obtaining the changed syllable. The first sequence length of the changed syllable is determined based on the second position and the last position in the target sequence.

[0022] Furthermore, the sequence determination module is further configured to: determine the first subsequence and the second subsequence in the target sequence based on the incremental position;

[0023] Based on the incremental position, a target subsequence is determined in the target sequence;

[0024] A second subsequence is determined based on the target syllable in the target subsequence, and the portion of the target subsequence other than the second subsequence is taken as the first subsequence, wherein the target syllable is the last syllable in the target subsequence.

[0025] Furthermore, the sequence determination module is also used to: determine the second subsequence based on the target syllables in the target subsequence.

[0026] Determine the change state of the target syllable following the changed syllable, wherein the change state is used to indicate that the target syllable changes in accordance with the changed syllable, or to indicate that the target syllable does not change in accordance with the changed syllable;

[0027] When the change state indicates that the target syllable changes in accordance with the changed syllable, the changed target syllable is taken as the second subsequence; or, when the change state indicates that the target syllable does not change in accordance with the changed syllable, the target syllable is taken as the second subsequence.

[0028] Furthermore, the intermediate state data includes a first embedded representation of the first word node, and the path determination module is further configured to: Invoke the target model based on the intermediate state data and the second word node to predict a third word node located after the second word node.

[0029] The target model is called to encode the second word node to obtain the second embedding representation of the second word node. The first embedding representation and the second embedding representation are concatenated to obtain the target embedding representation. The target embedding representation is then decoded to obtain the first probability distribution of the third word node located after the second word node.

[0030] The third word node is determined based on the first probability distribution.

[0031] Furthermore, the intermediate state data also includes the second probability distribution of the second word node. The step of calling the target model to encode the second word node to obtain its second embedding representation, and the path determination module is further configured to:

[0032] Obtain all fourth-character nodes under the second subsequence and input the fourth-character nodes into the target model;

[0033] Based on the second probability distribution, the second word node is selected from the fourth word node, and the second word node is encoded to obtain the second embedding representation of the second word node.

[0034] Furthermore, the word grouping path determination method further includes a path determination module that is also used for:

[0035] Obtain the target embedding representation output by the target model and save the target embedding representation.

[0036] Furthermore, the path determination module for saving the target embedding representation is also used for:

[0037] Hash processing is performed based on the target embedding representation to generate a first verification value;

[0038] The third word node, the target embedding representation, and the first check value are associated and saved.

[0039] Furthermore, the path determination module is further configured to: (1) Invoke the target model based on the intermediate state data and the second word node prediction, which is located before the third word node after the second word node.

[0040] Based on the first word node, the intermediate state data is retrieved, and the second verification value is generated when the intermediate state data is pre-saved;

[0041] The intermediate state data obtained from the retrieval is hashed to generate a third verification value, and the third verification value is matched with the second verification value for consistency.

[0042] On the other hand, this disclosure also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described word path determination method.

[0043] On the other hand, this disclosure also provides a computer-readable storage medium storing a computer program that is executed by a processor to implement the above-described word path determination method.

[0044] On the other hand, this disclosure also provides a computer program product comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the word path determination method described above.

[0045] The embodiments of this disclosure include at least the following beneficial effects: By acquiring the target sequence of the current input, a first subsequence and a second subsequence are determined in the target sequence. Since the second subsequence includes syllables located before and adjacent to the changed syllables, and the changed syllables are the syllables in the target sequence that generate input changes, and the first subsequence includes all syllables located before the second subsequence, the first subsequence can be used as the incremental part of the target sequence of the current input. Accordingly, the intermediate state data corresponding to the first subsequence can be read, and the target model can be called to predict the third character node located after the second character node based on the intermediate state data and the second character node. The word formation path of the target sequence is determined based on the first character node, the second character node, and the third character node. Since the intermediate state data is output by the target model and pre-saved when the target model predicts the second character node of the second subsequence based on the first character node of the first subsequence, it is equivalent to reusing the intermediate state data output by the target model when predicting the second character node, which can reduce the computational load of the target model when predicting the third character node, reduce the risk of stuttering in the word formation process, and improve the fluency of word formation.

[0046] Other features and advantages of this disclosure will be set forth in the following description and will be apparent in part from the description or may be learned by practicing this disclosure. Attached Figure Description

[0047] The accompanying drawings are provided to further understand the technical solutions of this disclosure and constitute a part of the specification. They are used together with the embodiments of this disclosure to explain the technical solutions of this disclosure and do not constitute a limitation on the technical solutions of this disclosure.

[0048] Figure 1 A schematic diagram of an optional implementation environment provided for an embodiment of this disclosure;

[0049] Figure 2 An optional flowchart of a word grouping path determination method provided in this disclosure embodiment;

[0050] Figure 3 An optional method for determining incremental positions provided in embodiments of this disclosure.

[0051] Figure 4 An optional schematic diagram for determining incremental positions provided in embodiments of this disclosure;

[0052] Figure 5 An optional schematic diagram for determining a second sub-sequence provided in an embodiment of this disclosure;

[0053] Figure 6 Another optional schematic diagram for determining the second sub-sequence provided in this embodiment of the disclosure;

[0054] Figure 7 This is an optional network structure diagram for the word node prediction model provided in this embodiment of the disclosure;

[0055] Figure 8 This is an optional schematic diagram illustrating the word network connection relationship provided in an embodiment of this disclosure;

[0056] Figure 9 An optional schematic flowchart for verifying intermediate state data provided in an embodiment of this disclosure;

[0057] Figure 10 An optional overall flowchart of the word grouping path determination method provided in this embodiment of the disclosure;

[0058] Figure 11 A schematic diagram of an optional model processing procedure provided for an embodiment of this disclosure;

[0059] Figure 12 A schematic diagram of another optional model processing procedure provided for an embodiment of this disclosure;

[0060] Figure 13 This is a schematic diagram of the structure of the word path determination device provided in the embodiments of this disclosure;

[0061] Figure 14 This is a partial structural block diagram of a terminal provided in an embodiment of the present disclosure;

[0062] Figure 15 This is a partial structural block diagram of a server provided in an embodiment of this disclosure. Detailed Implementation

[0063] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this disclosure.

[0064] It should be noted that in the various specific embodiments of this disclosure, when processing is required based on data related to the characteristics of the target object, such as target object attribute information or a set of attribute information, the permission or consent of the target object will be obtained first. Furthermore, the collection, use, and processing of this data will comply with relevant laws, regulations, and standards. The target object can be a user. In addition, when embodiments of this disclosure need to obtain target object attribute information, separate permission or consent from the target object will be obtained through pop-ups or redirection to a confirmation page. Only after obtaining the target object's separate permission or consent will the necessary target object-related data for the normal operation of the embodiments of this disclosure be obtained.

[0065] In this disclosure, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0066] To facilitate understanding of the technical solutions provided in the embodiments of this disclosure, some key terms used in the embodiments of this disclosure will be explained below:

[0067] Probability distribution: used to describe the likelihood of a random variable taking different values, and to give the probability or probability density of all possible values ​​of the random variable.

[0068] Semantic information: In natural language processing, it refers to the meaning, context, and intent of a text or sentence. It mainly focuses on understanding the deeper meaning expressed by the text and determining the specific meaning of a word or Chinese character in a specific text.

[0069] Continuous vectors are elements in a vector space that exhibit continuity, enabling them to capture more subtle changes and differences. They are suitable for describing complex data and system analysis. Such vectors can be viewed as a set of infinite sequences, containing all possible numerical combinations, and multiple continuous vectors can be summed to obtain a new continuous vector.

[0070] Artificial Intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to have perception, reasoning, and decision-making capabilities. AI technology is a comprehensive discipline involving a wide range of fields, encompassing both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, pre-trained model technology, operating / interactive systems, and mechatronics. Pre-trained models, also known as large models or foundational models, can be widely applied to downstream tasks in various areas of AI after fine-tuning. AI software technologies mainly include computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0071] Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Based on the cloud computing business model, cloud technology encompasses network technology, information technology, integration technology, management platform technology, and application technology. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can only be achieved through cloud computing.

[0072] With the development of information technology, text input via input methods has become a very mature technology. Typically, when a user inputs text, a deep learning model predicts and selects word-formation paths based on the user's input pinyin string, thereby generating candidate words. The input method segments the input pinyin string into syllables, then traverses the syllable string, queries the character database for all Chinese characters corresponding to each syllable to construct a character network, and calculates the score of the path formed by each node in the character network to assess its probability as a potential word. Due to the large scale of the character network, breadth-first search is used to optimize network search performance and improve search efficiency. In each layer of character nodes, the top N nodes with the highest scores are retained, and other nodes are removed. The search continues backward based on the path formed by the top N nodes with the highest scores. Finally, based on the score results, one or more optimal paths are selected, and the characters on the path are combined to obtain the word formation result. However, despite the optimized search technology, the large size of the character network means that the number of effective nodes remains high. When using a deep learning model to calculate the score for each potential path, the computational cost increases with the number of nodes, which may lead to a decrease in the response speed of the deep learning model. This delay will directly affect the efficiency of word grouping.

[0073] Based on this, the present disclosure provides a method, apparatus, electronic device and storage medium for determining word formation paths, which can reduce the risk of stuttering during the word formation process and improve the fluency of word formation.

[0074] Reference Figure 1 , Figure 1 This is a schematic diagram of an optional implementation environment provided by an embodiment of the present disclosure. The implementation environment includes a terminal 101 and a server 102, wherein the terminal 101 and the server 102 are connected through a communication network.

[0075] For example, terminal 101 obtains the currently input target sequence and sends the target sequence to server 102. Server 102 determines the first subsequence, the second subsequence, and the changed syllables. Based on the first sequence length of the first subsequence and the second sequence length of the second subsequence, it determines the increment position. Based on the increment position and the changed syllables, it determines the second subsequence and the first subsequence. It reads the intermediate state data corresponding to the first subsequence, calls the target model to predict the third character node located after the second character node based on the intermediate state data and the second character node, determines the word formation path of the target sequence based on the first character node, the second character node, and the third character node, obtains the final word formation result according to the word formation path, and sends the word formation result to terminal 101 and displays it on the screen.

[0076] Alternatively, terminal 101 can acquire the currently input target sequence, determine the first subsequence, the second subsequence, and the changed syllables in the target sequence, determine the increment position based on the first sequence length of the first subsequence and the second sequence length of the second subsequence, determine the second subsequence and the first subsequence based on the increment position and the changed syllables, read the intermediate state data corresponding to the first subsequence, call the target model to predict the third character node located after the second character node based on the intermediate state data and the second character node, determine the word formation path of the target sequence based on the first character node, the second character node, and the third character node, obtain the final word formation result according to the word formation path, and display the word formation result on the screen.

[0077] Server 102 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Additionally, server 102 can also be a node server in a blockchain network.

[0078] Terminal 101 may be a mobile phone, computer, smart voice interaction device, smart home appliance, vehicle terminal, etc., but is not limited to these. Terminal 101 and server 102 can be directly or indirectly connected through wired or wireless communication, and this embodiment of the disclosure does not impose any limitations.

[0079] The methods provided in this disclosure can be applied to different scenarios, including but not limited to input methods, artificial intelligence, cloud technology, and other scenarios.

[0080] Reference Figure 2 , Figure 2 This is an optional flowchart of a word grouping path determination method provided in an embodiment of the present disclosure. The word grouping path determination method can be executed by a terminal, or it can be executed by a server and a terminal in cooperation. The word grouping path determination method includes, but is not limited to, the following steps S201 to S203.

[0081] Step S201: Obtain the target sequence of the current input, and determine the first subsequence and the second subsequence in the target sequence.

[0082] In step S201, specifically, this embodiment of the disclosure takes a Chinese input method as an example. The target sequence can be the currently input pinyin string, composed of multiple syllables, each syllable consisting of one or more pinyin letters. The first subsequence and the second subsequence are both part of the target sequence. The second subsequence includes a syllable that is located before and adjacent to the changed syllable. Here, "located before the changed syllable" means that the input position is located before the changed syllable in the input direction of the target sequence. The input direction is the direction along the semantics of the target sequence. For example, if the input target sequence is "woaidushu", then the input direction is "wo" to "ai" to "du" to "shu". The first subsequence includes all syllables located before the second subsequence, including one or more syllables. The changed syllable is the syllable in the target sequence that produces input changes. The produced input changes can be the deletion or addition of pinyin letters in the changed syllable. For example, if the input target sequence is "woaidushu", and assuming that "shu" is a changed syllable, and "du" is located before "shu" in the input direction of the target sequence, that is, the second subsequence is "du", then the first subsequence is "woai".

[0083] After obtaining the target sequence of the current input, the pinyin string in the target sequence needs to be segmented into syllables. Specifically, a syllable is usually composed of an initial consonant and a final vowel. The initial consonant is the part at the beginning of the syllable, including b, p, m, f, d, t, n, l, g, k, h, j, q, x, zh, ch, sh, r, z, c, s; the final vowel is the part after the initial consonant in the syllable, including simple vowels, compound vowels, and nasal vowels. Simple vowels include a, o, e, i, u, v, etc.; compound vowels include ai, ei, ui, ao, ou, etc.; nasal vowels include an, en, in, un, ang, eng, ing, ong, etc. Based on the known correspondence between syllables and Chinese characters, as well as the structure and rules of syllables, all initial consonants are first identified in the pinyin string. Based on the position of the initial consonant, the final vowel is identified after the initial consonant. The identified initial consonants and final vowels are combined into syllables, and functional symbols or character symbols are used to segment adjacent syllables to facilitate subsequent processing of the target sequence.

[0084] In one possible implementation, during the process of determining the first and second subsequences in the target sequence, when the changed syllable does not cause input change, specifically, the length of the first sequence of the changed syllable and the length of the second sequence of the target sequence can be determined. An increment position is determined in the target sequence based on the difference between the second and first sequence lengths. The first and second subsequences are then determined based on the increment position. Here, the first sequence length is the number of pinyin letters constituting the changed syllable, and the second sequence length is the number of pinyin letters constituting the target sequence. The increment position serves as a dividing marker in the target sequence, used to separate changed and unchanged syllables. All syllables before the increment position are saved as intermediate state data for the target model. When the input sequence for the target model includes these syllables, they can be reused in the target model calculation without recalculation. The increment position in the target sequence can be the position of a single pinyin letter.

[0085] Specifically, for the input target sequence, the length of its second sequence and the length of its first sequence containing the varied syllables are determined. The increment position is determined based on the difference between the second and first sequence lengths. The longest complete syllable in the target sequence, consisting of the pinyin letter corresponding to the increment position and one or more pinyin letters preceding the increment position, is identified as the second subsequence. All syllables preceding the second subsequence are identified as the first subsequence. Taking the input target sequence “woaidushu” as an example, the target sequence after syllable segmentation is “wo'ai'du'shu”. Assuming the varied syllable is “shu”, the first sequence length is 3, the second sequence length is 9, and the difference between the second and first sequence lengths is 6. Therefore, the increment position is the 6th pinyin letter “u” arranged in the input direction sequence. The longest complete syllable formed by the pinyin letter “d” preceding the increment position and the pinyin letter “u” at the increment position is “du”. Therefore, the syllable “du” is the second subsequence, and the syllable sequence “woai” preceding the second subsequence is the first subsequence.

[0086] In one possible implementation, during the process of determining the first and second subsequences in the target sequence, when the changed syllable causes an input change, taking the target sequence "woaidushu" without an input change as an example, the target sequence after syllable segmentation is "wo'ai'du'shu". Deleting the last pinyin letter in this target sequence, the target sequence after the changed syllable causes an input change is "wo'ai'du'sh". The length of the first sequence of the changed syllable is 2, and the length of the second sequence of the target sequence is 8. The difference between the length of the second sequence and the length of the first sequence is 6. That is, the position of the 6th pinyin letter "u" arranged in the input direction order in the target sequence is the increment position. The longest complete syllable formed by the pinyin letter "d" before the increment position and the pinyin letter "u" at the increment position is "du". Therefore, the syllable "du" is the second subsequence, and the syllable sequence "woai" before the second subsequence is the first subsequence.

[0087] In one possible implementation, the incremental position in the target sequence is determined based on the difference between the length of the second sequence and the length of the first sequence. Specifically, when the changed syllable is the last syllable in the target sequence, the difference between the length of the second sequence and the length of the first sequence can be used as the incremental position in the target sequence. Specifically, when the target sequence is a continuous input state, the number of pinyin letters in the changed syllable gradually increases, and the previous target sequence has one less pinyin letter than the subsequent target sequence. The subsequent target sequence is taken as the current target sequence, and the second sequence length of the current target sequence is obtained. Based on the current target sequence, the first sequence length of the changed syllable is obtained, the difference between the second sequence length and the first sequence length is calculated, and position backtracking is performed based on this difference. The backtracked position is determined as the incremental position. Alternatively, when deleting pinyin letters in the target sequence, the number of pinyin letters in the changed syllable gradually decreases, and the previous target sequence has one more pinyin letter than the subsequent target sequence. The subsequent target sequence is taken as the current target sequence, and the second sequence length of the current target sequence is obtained. The length of the first sequence of the changed syllables is obtained based on the current target sequence. The difference between the length of the second sequence and the length of the first sequence is calculated. The position is backtracked based on the difference, and the backtracked position is determined as the incremental position.

[0088] In one possible implementation, when the changed syllable is any syllable in the target sequence other than the first and last syllables, the process of determining the increment position can specifically involve determining the sum of the lengths of all syllable sequences following the changed syllable to obtain a third sequence length, obtaining a fourth sequence length based on the sum of the first and third sequence lengths, and determining the increment position in the target sequence based on the difference between the second and fourth sequence lengths. Here, the third sequence length is the number of pinyin letters constituting all syllable sequences following the changed syllable, and the fourth sequence length is the number of pinyin letters constituting both the changed syllable and all syllable sequences following it.

[0089] Specifically, based on the input direction of the target sequence, the sum of the lengths of all syllable sequences following the changed syllable is obtained to get the third sequence length. When a syllable in the target sequence is input incorrectly, the corresponding position needs to be returned for correction. When a changed syllable in the target sequence is supplemented, the number of pinyin letters in the changed syllable increases, and the previous target sequence has one less pinyin letter than the subsequent target sequence. The subsequent target sequence is taken as the current target sequence, and the second sequence length of the current target sequence is obtained. Based on the current target sequence, the first sequence length of the changed syllable is obtained. The first sequence length is added to the third sequence length to get the fourth sequence length. The difference between the second and fourth sequence lengths is calculated, and position backtracking is performed based on this difference. The backtracked position is determined as the incremental position. Alternatively, when a pinyin letter in a changed syllable is deleted, the number of pinyin letters in the changed syllable decreases, and the previous target sequence has one more pinyin letter than the subsequent target sequence. The subsequent target sequence is taken as the current target sequence, and the second sequence length of the current target sequence is obtained. The length of the first sequence of the changed syllables is obtained based on the current target sequence. The length of the first sequence is added to the length of the third sequence to obtain the length of the fourth sequence. The difference between the length of the second sequence and the length of the fourth sequence is calculated, and the position is backtracked based on the difference. The backtracked position is determined as the incremental position.

[0090] In one possible implementation, when the changed syllable is the last syllable in the target sequence, and the position where the input change occurs is the last pinyin letter in the last syllable, the process of determining the first sequence length of the changed syllable can specifically involve determining the first position in the target sequence where the input change occurs. When the first position is the last position in the target sequence, a second position is searched forward from the first position until the second position and the first position form the longest complete syllable, thus obtaining the changed syllable. The first sequence length of the changed syllable is then determined based on the first and second positions. Here, the first position is the position where the input change occurs, which can be any pinyin letter in the input direction of the target sequence except for the first pinyin letter of the changed syllable; the forward search refers to searching for other pinyin letters in the input direction of the target sequence before the first position, with the second position preceding the first position; the longest complete syllable is the longest syllable among complete syllables composed of an initial consonant and a final vowel that conforms to the pinyin structure. For example, if the input is "xian", it can be divided into "xi'an", and its longest complete syllable is "xian".

[0091] Specifically, when the target sequence is continuously input, the pinyin letters are input into the changed syllables, and the position of the input pinyin letter is determined as the first position; or, when deleting pinyin letters from the target sequence, they are deleted from the changed syllables, and the position of the pinyin letter preceding and adjacent to the deleted pinyin letter is taken as the first position. Starting from the first position, other pinyin letters preceding the first position are searched forward, and the position of one of the pinyin letters preceding the first position is taken as the second position. Based on the input direction of the target sequence, the pinyin letters at the second position, the pinyin letters between the second and first positions, and the pinyin letters at the first position are combined. When the combined syllable forms the longest complete syllable, the syllable is determined as the changed syllable. The first sequence length of the changed syllable is determined by the total number of pinyin letters at the second position, the pinyin letters between the second and first positions, and the pinyin letters at the first position.

[0092] In one possible implementation, when the changed syllable is the last syllable in the target sequence, and the position where the input change occurs is any position other than the first and last positions, the process of determining the first sequence length of the changed syllable can specifically involve determining the first position in the target sequence where the input change occurs. If the first position is any position in the target sequence other than the first and last positions, a second position is searched backward from the first position until the second position and the last position in the target sequence form the longest complete syllable, thus obtaining the changed syllable. The first sequence length of the changed syllable is then determined based on the second position and the last position in the target sequence. Specifically, when the target sequence is in a continuous input state, pinyin letters are input into the changed syllable, and the position of the input pinyin letter is determined as the first position; or, when pinyin letters are deleted from the target sequence, they are deleted from the changed syllable, and the position of the pinyin letter preceding and adjacent to the deleted pinyin letter is taken as the first position. The position of the pinyin letter that causes the input change in the target sequence is determined as the first position, and other pinyin letters preceding the first position are searched backward from the first position. Based on the input direction of the target sequence, the pinyin letters at the second position, the pinyin letters between the second and last positions, and the pinyin letters at the last position in the target sequence are combined. When the combined syllable forms the longest complete syllable, the syllable is determined as a changed syllable. The first sequence length of the changed syllable is determined by the sum of the number of pinyin letters at the second position, the pinyin letters between the second and last positions in the target sequence, and the pinyin letters at the last position in the target sequence.

[0093] Furthermore, when the changed syllable is any syllable in the target sequence other than the first and last syllables, the process of determining the first sequence length of the changed syllable involves the following steps: Specifically, when the target sequence is in a continuous input state, pinyin letters are input into the changed syllable, and the position of the input pinyin letter is determined as the first position; or, when deleting pinyin letters from the target sequence, they are deleted from the changed syllable, and the position of the pinyin letter preceding and adjacent to the deleted pinyin letter is taken as the first position. The position of the pinyin letter that causes the input change in the target sequence is determined as the first position, and starting from the first position, other pinyin letters preceding the first position are searched forward. Based on the input direction of the target sequence, the pinyin letters at the second position, the pinyin letters between the second and first positions, and the pinyin letters at the first position are combined. When the combined syllable forms the longest complete syllable, this syllable is determined as the changed syllable. The first sequence length of the changed syllable is determined based on the total number of pinyin letters at the second position, the pinyin letters between the second and first positions, and the pinyin letters at the first position.

[0094] Furthermore, refer to Figure 3 , Figure 3 An optional flowchart for determining the incremental position provided in this embodiment of the disclosure may be used to calculate the first position first, then the second sequence length, and finally the incremental position. Specifically, after obtaining the first sequence length, the second sequence length, and the first position, the difference between the sorting position of the first position in the input direction of the target sequence and the first sequence length is calculated, and this difference is recorded as L (L≥0). The position is then traced back from the first position to the Lth position in the input direction of the target sequence, and the traced position is determined as the incremental position. Alternatively, after obtaining the first sequence length, the second sequence length, the third sequence length, the fourth sequence length, and the first position, the difference between the sorting position of the first position in the input direction of the target sequence and the first sequence length is calculated, and this difference is recorded as L (L≥0). The position is then traced back from the first position to the Lth position in the input direction of the target sequence, and the traced position is determined as the incremental position.

[0095] Reference Figure 4 , Figure 4 This is an optional schematic diagram illustrating incremental position determination provided in an embodiment of this disclosure. For example... Figure 4 As shown, the previous target sequence is "jijixiangshang". After segmenting the previous target sequence, we get "ji'ji'xiang'shang", where the changed syllable is "xiang". The length of the third sequence is the length of the syllable "shang", and the length of the third sequence is 5. When the last pinyin letter "g" in the changed syllable is deleted, the next target sequence is "ji'ji'xian'shang". The length of the second sequence is 13, the changed syllable is "xian", the length of the first sequence is 4, and the first position is the position of the pinyin letter "n" before and adjacent to the deleted position "g", which is the 8th position in the input direction of the target sequence. The difference between the first position (8) and the length of the first sequence (4) is calculated. The difference is 4. From the first position back to the 4th position in the input direction of the target sequence, that is, the position of the pinyin letter "i", the position of the pinyin letter "i" is the incremental position of the next target sequence "jijixianshang".

[0096] In one possible implementation, the process of determining the first and second subsequences from the target sequence can specifically involve determining the target subsequence based on the incremental position, determining the second subsequence based on the target syllables in the target subsequence, and using the portion of the target subsequence excluding the second subsequence as the first subsequence. Here, the target subsequence includes some syllables contained within the target sequence, and the connection order of each syllable in the target subsequence can be stored as intermediate state data of the target model. When the input sequence for calculation by the target model contains the target subsequence, the connection order of the target subsequence can be directly used; the target syllable is the last syllable in the target subsequence.

[0097] Specifically, the position of the increment position within the target sequence is determined. Based on the increment position, the sequence consisting of all the pinyin letters preceding the increment position and the pinyin letters at the increment position is defined as the target subsequence. The last syllable in the target subsequence is taken as the target syllable, which is then defined as the second subsequence, containing all the pinyin letters that make up the target syllable. Finally, the portion of the target subsequence excluding the second subsequence is defined as the first subsequence, completing the process of determining the first and second subsequences.

[0098] In one possible implementation, when determining the second subsequence based on the target syllable in the target subsequence, specifically, it can involve determining the change state of the target syllable following the changed syllable. When the change state indicates that the target syllable changes following the changed syllable, the changed target syllable is taken as the second subsequence; or, when the change state indicates that the target syllable does not change following the changed syllable, the target syllable is taken as the second subsequence. Here, the change state is used to indicate whether the target syllable changes following the changed syllable or not.

[0099] Specifically, when the changed syllable is the last syllable in the target sequence, the increment position is determined based on the first sequence length of the changed syllable and the second sequence length of the target sequence. Based on the increment position, a target subsequence is determined within the target sequence, and the last syllable in the target subsequence is taken as the target syllable. Next, pinyin letters are continuously input into the changed syllable, or any pinyin letter is deleted from the changed syllable. When the changed syllable produces an input change, the new target sequence after the input change needs to be re-segmented. The last syllable in the new target sequence is still the changed syllable. Based on the new changed syllable, the increment position, target subsequence, and target syllable are re-determined. The new target syllable and the new changed syllable are compared with the target syllable and the changed syllable before the change to determine the change state of the target syllable following the changed syllable. When the change state indicates that the target syllable follows the changed syllable, the changed target syllable is taken as the second subsequence.

[0100] Reference Figure 5 , Figure 5 This is an optional schematic diagram illustrating the determination of a second subsequence according to an embodiment of this disclosure. The input target sequence is "xiangkanfangao". The target sequence is segmented into syllables, and the segmented target sequence can be "xiang'kan'fan'gao". When the changed syllable is the last syllable in the target sequence, based on the segmented target sequence, the changed syllable is determined to be "gao", with a first sequence length of 3 and a second sequence length of 14. The increment position is determined based on the difference between the first sequence length and the second sequence length. The increment position is the position of the pinyin letter "n". All syllables before the increment position are determined as the target subsequence, which is "xiangkanfan". The last syllable of the target subsequence, "fan", is taken as the target syllable. After deleting the last letter of the syllable in the changed syllable, the new target sequence is "xiangkanfanga". Re-segmenting the new target sequence into syllables yields "xiang'kan'fang'a", where the new changed syllable is "a". The new increment position, determined based on the new changed syllable, is "g", and the new target subsequence is "xiangkanfang". The new target syllable is "fang". The new target syllable changes along with the new changed syllable, and the changed target syllable is taken as the second subsequence, which is "fang".

[0101] Alternatively, when the changed syllable is any syllable in the target sequence other than the first and last syllables, the sum of the lengths of all syllable sequences following the changed syllable is determined to obtain the third sequence length. The fourth sequence is obtained based on the sum of the first and third sequence lengths. The difference between the second and fourth sequence lengths is calculated to determine the increment position. Based on the increment position, the target subsequence is determined within the target sequence, and the last syllable in the target subsequence is taken as the target syllable. Next, consecutive pinyin letters are input into the changed syllable, or any pinyin letter is deleted from the changed syllable. When the changed syllable produces an input change, the new target sequence needs to be re-segmented. Based on the position of the changed syllable in the target sequence, syllables with high repetition of pinyin letters contained in the changed syllable are found in the corresponding or adjacent positions of the new target sequence and taken as new changed syllables. Based on the new changed syllables, the increment position, target subsequence, and target syllable are re-determined. The new target syllable and the newly changed syllable are compared with the original target syllable and the changed syllable to determine the change state of the new target syllable following the newly changed syllable. When the change state indicates that the new target syllable follows the newly changed syllable, the changed target syllable is taken as the second subsequence.

[0102] Reference Figure 6 , Figure 6 This is another optional schematic diagram for determining the second subsequence according to an embodiment of the present disclosure. The input target sequence is "ruguojintianwomen". The target sequence is segmented into syllables, and the segmented target sequence can be "ru'guo'jin'tian'wo'men". When the changing syllable is any syllable in the target sequence other than the first and last syllables, the sum of the lengths of all syllable sequences "women" after the changing syllable is calculated, resulting in a third sequence length of 5. The changing syllable is "tian", and its corresponding first sequence length is 4. The sum of the first sequence length and the third sequence length is then calculated, resulting in a fourth sequence length of 6. The second sequence length of the target sequence is 14. The increment position is determined based on the difference between the second sequence length and the fourth sequence length. The increment position is the position of the pinyin letter "n". All syllables before the increment position are determined as the target subsequence, which is "ruguojin". The last syllable of the target subsequence, "jin", is taken as the target syllable. When the letter "t" in the changed syllable is deleted, the new target sequence is "ruguojinianwomen". The new target sequence is re-segmented into syllables, resulting in "ru'guo'ji'nian'wo'men". The new changed syllable is "nian". The new increment position determined based on the new changed syllable is "i". The new target subsequence is "ruguoji" and the new target syllable is "ji". The new target syllable changes with the change of the new changed syllable. The changed target syllable is taken as the second subsequence, which is "ji".

[0103] Alternatively, when the altered syllable does not generate any input state, and the altered state indicates that the target syllable does not change along with the altered syllable, the target syllable is directly used as the second subsequence.

[0104] Step S202: Read the intermediate state data corresponding to the first subsequence.

[0105] Intermediate state data refers to the data output by the target sequence and pre-saved when the target model predicts the second word node in the second subsequence based on the first word node in the first subsequence. In other words, intermediate state data is the process data generated by the target model during runtime.

[0106] Before reading the intermediate state data corresponding to the first subsequence, each syllable in the target sequence needs to be converted into the corresponding Chinese character. Specifically, the first subsequence contains one or more syllables, the second subsequence contains one syllable, and each syllable corresponds to one or more Chinese characters. Traverse the data in the dictionary, generate a corresponding key for each syllable, and store the list of Chinese characters corresponding to the syllable as the value in the hash table. Since a syllable can be regarded as a simple string, the syllable string itself can be directly used as the hash value, or the hash value can be obtained by converting the syllable string. For the input target sequence, obtain the hash values corresponding to each syllable string, look up the key-value pairs corresponding to the hash values in the hash table. When a matching key is found, return the corresponding list of Chinese characters to obtain the list of Chinese characters corresponding to each syllable. The Chinese characters corresponding to the syllables are called word nodes. One Chinese character corresponds to one word node, that is, one syllable corresponds to one or more word nodes. The Chinese characters corresponding to the syllables under the first subsequence are the first word nodes, the Chinese characters corresponding to the syllables under the second subsequence are the second word nodes, and the Chinese characters corresponding to the changing syllables are the third word nodes. Since the first subsequence contains one or more syllables, the first subsequence contains one or more layers of word nodes.

[0107] In the target model, when processing the target sequence, first, encode the information of the list of Chinese characters in the first word nodes into the first embedding vector and output it by the target model, and save the first embedding vector as the intermediate state data of the target model. Then, predict the second word nodes under the second subsequence based on the first embedding vector, encode the information of the list of Chinese characters in the second word nodes into the second embedding vector and output it by the target model. Read the intermediate state data corresponding to the first subsequence from the target model, that is, the first embedding vector, and predict other word nodes after the second word nodes based on the first embedding vector and the second embedding vector. Among them, the target model is a pre-trained model. When a target sequence is input into the target model, it calculates and processes the target input based on the training data; the first embedding vector is used to represent the intermediate state data corresponding to the first subsequence, and the second embedding vector is used to represent the intermediate state data corresponding to the second subsequence.

[0108] Step S203: Call the target model to predict the third word nodes after the second word nodes based on the intermediate state data and the second word nodes, and determine the word combination path of the target sequence based on the first word nodes, the second word nodes and the third word nodes.

[0109] Among them, the third word nodes can be the word nodes under the changing syllables. The word combination path is a path formed by connecting multiple word nodes in sequence. One word combination path can determine a candidate word corresponding to the target sequence. For example, assume that the first word nodes are "I" and "love", the second word node is "read", and the third word node is "book", then the word combination path can be "I-love-read-book", and the corresponding candidate word at this time is "I love reading".

[0110] In one possible implementation, the intermediate state data includes a first embedding representation of the first character node. Specifically, when calling the target model to predict the third character node following the second character node based on the intermediate state data and the second character node, the target model can encode the second character node to obtain a second embedding representation. The first and second embedding representations are then concatenated to obtain a target embedding representation. Decoding this target embedding representation yields a first probability distribution for the third character node following the second character node. Here, the embedding representation represents the semantic information and positional information of each Chinese character in the character node, and can be represented by a continuous vector. The first embedding representation includes the semantic information of all Chinese characters in the first character node and the positional information of the syllable corresponding to the first character node in the input direction of the target sequence. The second embedding representation includes the semantic information of all Chinese characters in the second character node and the positional information of the syllable corresponding to the second character node in the input direction of the target sequence. The second character node contains the top N most probable Chinese characters corresponding to the syllables under that second character node.

[0111] Specifically, in the target model, all Chinese characters in the first character node are converted into corresponding first continuous vectors. A first vector dimension is set for these continuous vectors, and the first continuous vectors are encoded to obtain a first embedding representation of the first character node containing rich semantic information. This first embedding representation is saved as intermediate state data of the target model. Next, all Chinese characters in the second character node are converted into corresponding second continuous vectors. A second vector dimension is set for the second continuous vectors, where the value of the second vector dimension is the same as the value of the first vector dimension. The second continuous vectors are encoded to obtain a second embedding representation of the second character node containing rich semantic information. The first embedding representation and the second embedding representation are concatenated along the dimensional direction to obtain the target embedding representation. The target embedding representation is decoded to predict the list of Chinese characters in the third character node following the second character node, obtaining a first probability distribution of all Chinese characters in the third character node following the second character node.

[0112] Furthermore, based on the first probability distribution, the Chinese character with the highest probability is determined as the third character node; or, when there are other character nodes after the third character node, the Chinese characters in the third character node are arranged from high to low according to the probability distribution, and the first N characters with the highest probability are selected as the third character node. The third character node is further determined based on the information of other character nodes after the third character node.

[0113] It should also be noted that for each character node, especially in the first character node where there may be multiple levels of character nodes, it is necessary to determine the position of each character node in the target sequence. After encoding all the Chinese character information in the first character node and the second character node and converting it into corresponding vectors, based on the input direction of the target sequence, encode the positions of all the syllables corresponding to the Chinese characters in the first character node, the second character node, and the third character node, and obtain the position encoding corresponding to each syllable. This position encoding is used to represent the position sequence information of the syllable in the input direction of the target sequence. By encoding the position information, the context information between adjacent character nodes can be obtained, thereby improving the language understanding and semantic analysis capabilities of the target model.

[0114] Refer to Figure 7 , Figure 7 which is an optional network structure diagram of the character node prediction model provided by the embodiments of the present disclosure. The pinyin input sequence of the prediction model is [a1, a2, a3, a4,... a n . Encoding is performed on each character node corresponding to each syllable in the pinyin input sequence. Among them, t is the character node corresponding to the t-th syllable in the pinyin input sequence, and t < n. When encoding the a3 character node, first input the a3 character node into the embedding layer, convert all the Chinese characters in the a3 character node into corresponding continuous vectors respectively, and perform position encoding on the position of a3 in the pinyin input sequence to obtain the position information of a3. Input the continuous vector and the position information into the encoding network of the prediction model for encoding. After passing through multiple encoding blocks, an a3 embedding representation with rich semantic information is obtained. Concatenate the a3 embedding representation with the a1a2 embedding representation to obtain an embedding representation set, and save the embedding representation set as the intermediate state data of the prediction model. Then input the embedding representation set into the decoding network of the prediction model for decoding. After passing through multiple decoding blocks, the prediction result of the a4 character node is obtained, and at the same time, the probability distribution of all the Chinese characters in the a4 character node is obtained.

[0115] In a possible implementation, the intermediate state data further includes the second probability distribution of the second character node. When calling the target model to encode the second character node, in the process of obtaining the second embedding representation of the second character node, specifically, all the fourth character nodes under the second subsequence can be obtained, input the fourth character nodes into the target model, screen out the second character node from the fourth character nodes based on the second probability distribution, and encode the second character node to obtain the second embedding representation of the second character node. Among them, all the fourth character nodes under the second subsequence represent all the Chinese characters corresponding to the syllables in the second subsequence.

[0116] Specifically, based on the dictionary, all Chinese characters corresponding to the syllables in the second subsequence are obtained. These characters are then grouped into fourth character nodes. The first embedding representation is decoded to predict the list of Chinese characters corresponding to all fourth character nodes in the second subsequence following the first character node in the first subsequence, thus obtaining the second probability distribution of all fourth character nodes in the second subsequence. In the target model, based on the second probability distribution, the top N Chinese characters with the highest probabilities from the fourth character nodes are selected as second character nodes. All Chinese characters contained in the second character nodes are converted into corresponding second continuous vectors, and these second continuous vectors are encoded to obtain the second embedding representation of the second character nodes.

[0117] In one possible implementation, the intermediate state data includes a first embedding representation of the first character node, a second embedding representation of the second character node, a second probability distribution of the second character node, and a target embedding representation. Specifically, saving the intermediate state data can involve obtaining and saving the target embedding representation output by the target model. Specifically, all Chinese characters contained in the first character node are converted into corresponding first continuous vectors, and these first continuous vectors are encoded to obtain the first embedding representation. This first embedding representation is saved as intermediate state data of the target model. The first embedding representation is then decoded to predict the list of Chinese characters corresponding to all fourth character nodes in the second subsequence following the first character node in the first subsequence, obtaining the second probability distribution of all fourth character nodes in the second subsequence. This second probability distribution is saved as intermediate state data of the target model. Next, based on the second probability distribution, the top N Chinese characters with the highest probabilities from the fourth character nodes are selected as the second character nodes. All Chinese characters contained in the second character nodes are converted into corresponding second continuous vectors, and these second continuous vectors are encoded to obtain the second embedding representation. This second embedding representation is saved as intermediate state data of the target model. The first embedding representation and the second embedding representation are concatenated along the dimensional direction to obtain the target embedding representation, which is then saved as intermediate state data of the target model.

[0118] Reference Figure 8 , Figure 8An optional schematic diagram of the word network connection relationship provided by an embodiment of the present disclosure. The input target sequence is "woaidushu". After syllable segmentation of the target sequence, "wo’ai’du’shu" is obtained. The first word node includes two layers of word nodes. The first word node in the first layer is "wo", and the second word node in the second layer is "ai". The second word node is "du", and the third word node is "shu". In the first word node, two paths of "我-爱" and "我-挨" can be obtained. The semantic information and position information of these two paths are saved as the intermediate state data of the target model as the first embedding representation. Then, based on the first embedding representation and the second probability distribution, the first 4 words with the highest probabilities corresponding to the syllable "du" in the fourth word node are selected as the second word node, which are "堵", "读", "度", "杜" respectively, and the second embedding representation is obtained. According to the connection weights between the first embedding representation and the second embedding representation for splicing, five paths of "我-爱-读", "我-爱-度", "我-爱-杜", "我-挨-堵", "我-挨-度" can be obtained. The semantic information and position information of these five paths are saved as the target embedding representation as the intermediate state data of the target model. Finally, based on the target embedding representation, all Chinese characters corresponding to the syllable "shu" in the third word node are predicted, including "书", "数", "树", "输", "术", "梳", etc. All Chinese characters in the third word node and the five paths in the second embedding representation form new paths, and paths such as "我-爱-读-书", "我-爱-读-数", "我-爱-读-术", "我-爱-杜-数", "我-挨-度-树", "我-挨-度-数" can be obtained, and the probability representations of each new path are calculated.

[0119] In a possible implementation manner, when saving the target embedding representation, specifically, hash processing can be performed based on the target embedding representation to generate a first check value, and the third word node, the target embedding representation, and the first check value are associated and saved. Specifically, the first check value is used to indicate that the intermediate state data used by the target model is the target embedding representation, and it can be composed of a string of numbers. The first embedding representation and the second embedding representation are spliced to obtain the target embedding representation, and the hash function is used to perform hash processing on the target embedding representation to map the target embedding representation to a hash value with a fixed length, and this hash value with a fixed length is used as the first check value. Then, the third word node, the target embedding representation, and the first check value are associated and saved. These information can be stored in a file in a structured format such as JSON or XML. Among them, the third word node and the target embedding representation can be saved in binary form, and the first check value can be directly saved as a string.

[0120] In one possible implementation, before calling the target model to predict the third word node located after the second word node based on intermediate state data and the second word node, specifically, this can involve retrieving intermediate state data from the first word node and generating a second verification value when pre-saving the intermediate state data. The retrieved intermediate state data is then hashed to generate a third verification value, which is then matched for consistency with the second verification value. Specifically, the second verification value indicates that the intermediate state data used by the target model is a first embedding representation, and the third verification value indicates the retrieved intermediate state data. (See reference...) Figure 9 , Figure 9 This is an optional schematic flowchart for verifying intermediate state data provided in an embodiment of this disclosure. After encoding the first word node, a first embedded representation is obtained. A hash function is used to hash the first embedded representation, mapping it to a second check value. The first word node, the first embedded representation, and the second check value are associated and saved as intermediate state data of the target model. In the target model, a third word node needs to be predicted based on the input first embedded representation and the second word node. When obtaining the first embedded representation, the corresponding intermediate state data and the second check value generated when the intermediate state data is pre-saved are retrieved from the saved file based on the first word node. The retrieved intermediate state data is then hashed to generate a third check value. The third check value is matched with the second check value. When the third check value and the second check value are exactly the same, it indicates that the third check value and the second check value have matched successfully, that is, the intermediate state data retrieved based on the first word node is the first embedded representation, which can be used to predict the third word node. When it indicates that the third check value and the second check value have failed to match, the corresponding intermediate state data and the second check value are retrieved again from the saved file based on the first word node. By verifying the retrieved intermediate state data, the integrity of the retrieved intermediate state data can be guaranteed, reducing the large prediction error of the third word node caused by the incompleteness of the intermediate state data.

[0121] Reference Figure 10 , Figure 10 The following is an optional overall flowchart of the word grouping path determination method provided in this embodiment of the disclosure. Taking a Chinese input method as an example, the principle of the word grouping path determination method in this embodiment of the disclosure is described in general and in complete form:

[0122] First, the input Pinyin string is obtained and segmented into syllables. Based on the known correspondence between syllables and Chinese characters, as well as the structure and rules of syllables, all initials are identified in the Pinyin string. Then, based on the position of the initials, finals are identified after them. The identified initials and finals are combined into syllables. Functional symbols or character symbols are used to segment adjacent syllables, facilitating subsequent processing of the input Pinyin string.

[0123] After the pinyin string is segmented into syllables, syllables that produce input changes are identified as changed syllables. When adding or deleting pinyin letters from changed syllables in the input pinyin string, the position of the newly added or deleted pinyin letter, and the position of the pinyin letter preceding and adjacent to it, is designated as the difference position. When the difference position is at the last position of a changed syllable, other pinyin letters preceding the difference position are searched forward from the difference position. When one or more of the searched pinyin letters, when combined with the pinyin letters at the difference position, form the longest complete syllable, this syllable is identified as a new changed syllable. The first sequence length of the new changed syllable is obtained. The difference L between the sorting position of the difference position in the input direction of the pinyin string and the first sequence length is calculated. The process is then backtracked from the difference position to the Lth position in the input direction of the pinyin string, and the backtracked position is designated as the increment position. Alternatively, when the difference position is located in a variadic syllable other than the first and last positions, search forward from the difference position to find other pinyin letters before the difference position. When the pinyin letters found, the pinyin letters at the difference position, and the pinyin letters after the difference position in the variadic syllable can be combined to form the longest complete syllable, the syllable is identified as the new variadic syllable. The first sequence length of the new variadic syllable is obtained. The difference L between the sorting position of the difference position in the input direction of the pinyin string and the first sequence length is calculated. The variadic position is backtracked to the Lth position in the input direction based on the pinyin string, and the backtracked position is identified as the incremental position.

[0124] The incremental position serves as a dividing marker in the input pinyin string, used to separate changed syllables from other syllables. All syllables before the incremental position are saved as intermediate state data for the deep learning model. When the input pinyin sequence calculated by the deep learning model contains these syllables, these syllables can be reused in the deep learning model calculation without being recalculated. The incremental position in the input pinyin string can be the position of a certain pinyin letter.

[0125] After determining the increment position in the pinyin string, the syllables preceding the increment position are identified as sub-pinyin strings. Simultaneously, the last syllable in the sub-pinyin string is identified as the target syllable, which is the syllable of the second subsequence. The portion of the sub-pinyin string excluding the second subsequence is considered the first subsequence, thus determining the syllables contained within the first and second subsequences. Since the target syllable in the second subsequence is adjacent to a changed syllable, a change in the input of the changed syllable may cause the target syllable to change as well. For syllables that change the input, the new pinyin string after the input change needs to be re-segmented. When the changed syllable is the last syllable of the input pinyin string, the last syllable of the new pinyin string is still the changed syllable. Based on the new changed syllable, the increment position, sub-pinyin string, and target syllable are redefined, and the redefined target syllable is used as the second subsequence. Alternatively, when the changed syllable is any syllable in the input pinyin string other than the first and last syllables, based on the position of the changed syllable in the pinyin string, the syllable with a high degree of repetition of the pinyin letters contained in the changed syllable is found in the corresponding position or adjacent position of the new pinyin string, and it is used as the new changed syllable. Based on the new changed syllable, the increment position, sub-pinyin string, and target syllable are redefined, and the redefined target syllable is used as the second subsequence.

[0126] Next, each syllable in the input Pinyin string is converted into its corresponding Chinese character. In the input Pinyin string, the first subsequence contains one or more syllables, the second subsequence contains one syllable, and each syllable corresponds to one or more Chinese characters. The data in the dictionary is traversed, generating a corresponding key for each syllable, and storing the list of Chinese characters corresponding to the syllable as the value in a hash table. Since a syllable can be considered a simple string, the syllable string itself can be used directly as the hash value, or the syllable string can be converted to obtain the hash value. For the input target sequence, the hash value corresponding to each syllable string is obtained, and the key-value pair corresponding to the hash value is searched in the hash table. When a matching key is found, the corresponding list of Chinese characters is returned, resulting in the list of Chinese characters corresponding to each syllable. The Chinese characters corresponding to each syllable are called character nodes, with one character corresponding to one character node. The Chinese characters corresponding to the syllables in the first subsequence are the first character nodes, the Chinese characters corresponding to the syllables in the second subsequence are the second character nodes, and the Chinese characters corresponding to the changed syllables are the third character nodes. Since the first subsequence contains one or more syllables, it contains one or more layers of character nodes.

[0127] Next, the first and second character nodes are input into the deep learning model for processing. First, all Chinese characters in the first character node are converted into corresponding first continuous vectors. A first vector dimension is set for these continuous vectors, and the first continuous vectors are encoded to obtain a first embedding representation of the first character node containing rich semantic information. This first embedding representation is output by the deep learning model and saved as intermediate state data of the target model. Next, based on the first embedding representation, the list of Chinese characters in the second character node is predicted. All Chinese characters in the second character node are converted into corresponding second continuous vectors. A second vector dimension is set for the second continuous vectors, where the value of the second vector dimension is the same as the value of the first vector dimension. The second continuous vectors are encoded to obtain a second embedding representation of the second character node containing rich semantic information, which is also output by the deep learning model. The intermediate state data corresponding to the first subsequence, i.e., the first embedding vector, is read from the deep learning model. The first embedding representation and the second embedding representation are concatenated along the dimensional direction to obtain the target embedding representation, which is saved as intermediate state data of the deep learning model. Based on the target embedding representation, the list of Chinese characters in the third character node can be predicted, resulting in the first probability distribution of all Chinese characters in the third character node. According to the first probability distribution, the Chinese character with the highest probability is determined as the third character node; alternatively, when other character nodes exist after the third character node, the Chinese characters in the third character node are arranged from highest to lowest probability according to the probability distribution, and the top N characters with the highest probabilities are selected as the third character node. The third character node is further determined based on the information of other character nodes after the third character node. The intermediate state data is the data output by the target sequence and pre-saved when the target model predicts the second character node in the second subsequence based on the first character node in the first subsequence. In other words, the intermediate state data is the process data generated by the target model during runtime.

[0128] Before encoding the character nodes, since the number of valid character nodes formed by the syllables in the first subsequence and the syllables in the second subsequence is relatively large, it is necessary to select the top N characters as the first or second character node based on the probability distribution of each character node. After obtaining the first character node, it is encoded to obtain the first embedding representation. Based on the first embedding representation, all character nodes in the second subsequence are predicted, and these character nodes are used as the fourth character node. The second probability distribution of the fourth character node is obtained and saved as intermediate state data of the deep learning model. Based on the second probability distribution, the top N characters with the highest probabilities from the fourth character node are selected as the second character node, and this second character node is used to predict the third character node.

[0129] Furthermore, for each character node, especially the first character node which may contain multiple layers of character nodes, it is necessary to determine the position of each character node in the target sequence. Therefore, the first and second embedding representations, in addition to containing the semantic information of each Chinese character in the character node, also contain the position information of the syllable corresponding to each character node in the input pinyin string. After encoding all the Chinese character information in the first and second character nodes and converting it into corresponding vectors, based on the input direction of the input pinyin string, the positions of the syllables corresponding to all Chinese characters in the first and second character nodes are encoded to obtain the positional encoding for each syllable. This positional encoding is used to represent the positional order information of the syllable in the input direction of the input pinyin string. By encoding the positional information, the contextual information between adjacent character nodes can be obtained, thereby improving the language understanding and semantic analysis capabilities of the deep learning model.

[0130] It should also be noted that the optimized deep learning model has an incremental architecture. Each time inference is performed, the inference result can be saved as intermediate state data for the deep learning model. The next time inference is performed, the previously saved intermediate state data can be fed into the model along with the input pinyin string to be processed for inference, and the inference result output by the model at that time can then be saved as intermediate state data for the deep learning model. The deep learning model can employ network structures such as Convolutional Neural Networks (CNN), Recurrent Neural Networks (RNN), Graph Neural Networks (GNN), or transformers; this application does not impose any specific limitations.

[0131] Next, to ensure that the intermediate state data used in the deep learning model computation is either the first embedding representation or the target embedding representation, a corresponding checksum needs to be generated when the first or target embedding representation is saved. When saving the first embedding representation of the first word node as intermediate state data for the deep learning model, the first embedding representation is hashed to generate a second checksum. Then, the first word node, the first embedding representation, and the second checksum are associated and saved. Next, after obtaining the second embedding representation of the second word node based on the first embedding representation, the corresponding intermediate state data and the second checksum generated when the intermediate state data was pre-saved are retrieved from the saved file based on the first word node. The retrieved intermediate state data is then hashed to generate a third checksum. The third checksum is then matched against the second checksum. If the third checksum is identical to the second checksum, it indicates that the intermediate state data retrieved based on the first word node is the corresponding first embedding representation. The first embedding representation is concatenated with the second embedding representation to obtain the target embedding representation. The third word node is predicted based on the target embedding representation. The target embedding representation is hashed to generate the first verification value. Then, the target embedding representation, the third word node, and the first verification value are associated and saved for use in the next deep learning model calculation.

[0132] When associating and saving word nodes, embedded representations, and hash values, this information can be stored in a file in structured formats such as JSON and XML. Word nodes and embedded representations can be saved in binary form, and checksums can be saved directly as strings.

[0133] Finally, the target embedding representation is obtained based on the first embedding representation, the second embedding representation, and the second probability distribution. The third word node is predicted based on this target embedding representation, i.e., starting from the incremental position, the score of the path formed by the word nodes before and after the incremental position is calculated. According to the probability distribution of each word node, the connection weights of adjacent word nodes and the score of the path formed by these word nodes are calculated. The higher the probability of a word node, the greater its connection weight, and the higher the score of the path formed by that word node. The path with the highest score is obtained, and the word nodes on that path are combined to form the final word grouping result. The calculation result and the intermediate state data of the deep learning model are saved for subsequent incremental word grouping.

[0134] It should also be noted that the probability distribution of word nodes is calculated based on the frequency of Chinese characters used in daily life; the connection weight between adjacent word nodes indicates the possibility of combining two adjacent word nodes. The higher the connection weight, the higher the possibility that the two word nodes can be correctly combined, which can be calculated based on the word formation habits and frequencies in daily use, or can be calculated based on the probability distribution of adjacent word nodes, or can also be obtained through weighted calculation based on the word formation habits and frequencies in daily use and the probability distribution of adjacent word nodes.

[0135] The following is illustrated with an actual example. Refer to Figure 11 , Figure 11 which is a schematic diagram of an optional model processing process provided by an embodiment of the present disclosure. Assume that the input pinyin string is "woaidushu". Taking the word formation path "我爱读书" as an example for illustration. First, for "我", the input to the model is "null" (i.e., an empty character). At this time, the target model outputs the probability distribution of all candidate word nodes based on "null", as well as the intermediate state data corresponding to "null" (i.e., the embedding representation corresponding to "null"), and then determines the word node corresponding to "我" from the probability distribution; then, for "爱", the input to the model is "我" and the intermediate state data corresponding to "null". At this time, the target model outputs the probability distribution of all candidate word nodes based on "我", as well as the intermediate state data corresponding to "我" (i.e., the embedding representation corresponding to "我"), and then determines the word node corresponding to "爱" from the probability distribution; then, for "读", the input to the model is "爱" and the intermediate state data corresponding to "我". At this time, the target model outputs the probability distribution of all candidate word nodes based on "我爱", as well as the intermediate state data corresponding to "我爱" (i.e., the embedding representation corresponding to "我爱"), and then determines the word node corresponding to "读" from the probability distribution; then, for "书", the input to the model is "读" and the intermediate state data corresponding to "我爱". At this time, the target model outputs the probability distribution of all candidate word nodes based on "我爱读", as well as the intermediate state data corresponding to "我爱读" (i.e., the embedding representation corresponding to "我爱读"), and then determines the word node corresponding to "书" from the probability distribution.

[0136] In addition, refer to Figure 12 , Figure 12Another optional schematic diagram of the model processing process provided by the embodiments of the present disclosure. Continuing with the above example, for the syllable "wo", the word combination path "我" is filtered out; for the syllable "woai", the word combination paths "我爱" and "我挨" are filtered out; for the syllable "woaidu", the word combination paths "我爱读", "我爱度", "我爱杜", "我挨堵", and "我挨度" are filtered out; for the syllable "woaidushu", it only needs to calculate the probability distributions of the word combination paths "我爱读*", "我爱度*", "我爱杜*", "我挨堵*", and "我挨度*" respectively. It can be seen that the target model only needs to calculate 5 times to obtain the final word combination path of "woaidushu", thereby improving the processing efficiency of the target model and the fluency of word combination.

[0137] It can be understood that although the steps in each of the above flowcharts are shown in sequence according to the indication of the arrows, these steps do not necessarily need to be executed in the order indicated by the arrows. Unless there is a clear indication in this embodiment, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above flowcharts may include multiple steps or multiple stages. These steps or stages do not necessarily need to be executed at the same time, but can be executed at different times. The execution order of these steps or stages does not necessarily need to be sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0138] Refer to Figure 13 , Figure 13 The structural schematic diagram of the word combination path determination device provided by the embodiments of the present disclosure. The word combination path determination device 1300 includes:

[0139] A sequence determination module 1301, configured to obtain a target sequence of the current input, and determine a first subsequence and a second subsequence in the target sequence, where the second subsequence includes the syllable adjacent to and before the changing syllable, and the changing syllable is the syllable with an input change in the target sequence, and the first subsequence includes all syllables before the second subsequence;

[0140] A data reading module 1302, configured to read the intermediate state data corresponding to the first subsequence, where the intermediate state data is output by the target model and pre-saved when the target model predicts the second word node under the second subsequence based on the first word node under the first subsequence;

[0141] The path determination module 1303 is used to call the target model to predict the third character node after the second character node based on the intermediate state data and the second character node, and to determine the word formation path of the target sequence based on the first character node, the second character node and the third character node.

[0142] Furthermore, the sequence determination module 1301 is also used to determine the first subsequence and the second subsequence in the target sequence, and to further:

[0143] Determine the length of the first sequence of altered syllables, and determine the length of the second sequence of the target sequence;

[0144] The increment position in the target sequence is determined based on the difference between the length of the second sequence and the length of the first sequence, and the first subsequence and the second subsequence are determined in the target sequence based on the increment position.

[0145] Furthermore, the sequence determination module 1301 is also used to determine the increment position in the target sequence based on the difference between the length of the second sequence and the length of the first sequence, and to further:

[0146] When the changed syllable is the last syllable in the target sequence, the difference between the length of the second sequence and the length of the first sequence is used as the incremental position in the target sequence;

[0147] Alternatively, when the altered syllable is any syllable in the target sequence other than the first and last syllables, the sum of the lengths of all syllable sequences following the altered syllable is determined to obtain the third sequence length. The fourth sequence length is obtained based on the sum of the first and third sequence lengths. The increment position in the target sequence is determined based on the difference between the second and fourth sequence lengths.

[0148] Furthermore, when the altered syllable is the last syllable in the target sequence, the first sequence length of the altered syllable is determined. The sequence determination module 1301 is also used for:

[0149] In the target sequence, determine the first position that generates the input change. When the first position is the last position in the target sequence, start searching backward from the first position for the second position until the second position and the first position form the longest complete syllable. The changed syllable is obtained. The length of the first sequence of the changed syllable is determined based on the first position and the second position.

[0150] Alternatively, determine the first position in the target sequence that produces the input change. If the first position is any position in the target sequence other than the first and last positions, start searching backward from the first position for the second position until the second position and the last position in the target sequence form the longest complete syllable. The changed syllable is obtained, and the first sequence length of the changed syllable is determined based on the second position and the last position in the target sequence.

[0151] Furthermore, based on the incremental position, the first subsequence and the second subsequence are determined in the target sequence. The sequence determination module 1301 is also used for:

[0152] Determine the target subsequence in the target sequence based on the incremental position;

[0153] The second subsequence is determined based on the target syllable in the target subsequence, and the part of the target subsequence other than the second subsequence is taken as the first subsequence, where the target syllable is the last syllable in the target subsequence.

[0154] Furthermore, the second subsequence is determined based on the target syllables in the target subsequence. The sequence determination module 1301 is also used for:

[0155] Determine the change state of the target syllable following the changed syllable, where the change state is used to indicate whether the target syllable changes following the changed syllable or to indicate whether the target syllable changes not following the changed syllable;

[0156] When the change state indicates that the target syllable changes along with the changed syllable, the changed target syllable is taken as the second subsequence; or, when the change state indicates that the target syllable does not change along with the changed syllable, the target syllable is taken as the second subsequence.

[0157] Furthermore, the intermediate state data includes the first embedded representation of the first word node. The target model is invoked to predict the third word node located after the second word node based on the intermediate state data and the second word node. The path determination module 1303 is also used for:

[0158] The target model is called to encode the second word node to obtain the second embedding representation of the second word node. The first embedding representation is concatenated with the second embedding representation to obtain the target embedding representation. The target embedding representation is then decoded to obtain the first probability distribution of the third word node located after the second word node.

[0159] The third word node is determined based on the first probability distribution.

[0160] Furthermore, the intermediate state data also includes the second probability distribution of the second word node. The target model is called to encode the second word node to obtain the second embedding representation of the second word node. The path determination module 1303 is also used for:

[0161] Obtain all fourth-word nodes in the second subsequence and input the fourth-word nodes into the target model;

[0162] The second word node is selected from the fourth word node based on the second probability distribution, and the second word node is encoded to obtain the second embedding representation of the second word node.

[0163] Furthermore, the path determination module 1303 is also used for:

[0164] Obtain the target embedding representation output by the target model and save the target embedding representation.

[0165] Furthermore, in storing the target embedding representation, the path determination module 1303 is also used for:

[0166] Hash processing is performed based on the target embedding representation to generate the first verification value;

[0167] The third word node, the target embedding representation, and the first check value are associated and saved.

[0168] Furthermore, the path determination module 1303, which calls the target model based on intermediate state data and the second word node prediction, is located before the third word node after the second word node. It is also used for:

[0169] The intermediate state data is retrieved based on the first word node, and the second verification value is generated when the intermediate state data is pre-saved.

[0170] The intermediate state data obtained from the retrieval is hashed to generate a third verification value, which is then matched with the second verification value for consistency.

[0171] The electronic device provided in this disclosure for executing the above-described word grouping path determination method can be a terminal, as shown in the following embodiments. Figure 14 , Figure 14 This is a partial structural block diagram of a terminal provided in an embodiment of the present disclosure. The terminal includes: a camera assembly 1410, a first memory 1420, an input unit 1430, a display unit 1440, a sensor 1450, an audio circuit 1460, a wireless fidelity (WiFi) module 1470, a first processor 1480, and a first power supply 1490, among other components. Those skilled in the art will understand that... Figure 14 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0172] The camera assembly 1410 can be used to capture images or videos. Optionally, the camera assembly 1410 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions.

[0173] The first memory 1420 can be used to store software programs and modules. The first processor 1480 executes various functional applications and data processing of the terminal by running the software programs and modules stored in the first memory 1420.

[0174] The input unit 1430 can be used to receive input numeric or character information, and to generate key signal inputs related to the settings and function control of the terminal. Specifically, the input unit 1430 may include a touch panel 1431 and other input devices 1432.

[0175] Display unit 1440 can be used to display input or provided information, as well as various menus of the terminal. Display unit 1440 may include display panel 1441.

[0176] Audio circuitry 1460, speaker 1461, and microphone 1462 provide an audio interface.

[0177] The first power source 1490 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery.

[0178] The number of sensors 1450 can be one or more, and these sensors 1450 include, but are not limited to: accelerometers, gyroscopes, pressure sensors, optical sensors, etc.

[0179] An accelerometer can detect the magnitude of acceleration along the three axes of a coordinate system established by the terminal. For example, an accelerometer can be used to detect the components of gravitational acceleration along the three axes. The first processor 1480 can control the display unit 1440 to display the user interface in either a horizontal or vertical view based on the gravitational acceleration signal acquired by the accelerometer. The accelerometer can also be used for games or for acquiring user motion data.

[0180] The gyroscope sensor can detect the terminal's orientation and rotation angle. It can work in conjunction with an accelerometer to collect 3D user movements on the terminal. Based on the data collected by the gyroscope sensor, the first processor 1480 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.

[0181] The pressure sensor can be installed on the side bezel of the terminal and / or on the lower layer of the display unit 1440. When the pressure sensor is installed on the side bezel of the terminal, it can detect the user's grip signal on the terminal, and the first processor 1480 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor. When the pressure sensor is installed on the lower layer of the display unit 1440, the first processor 1480 can control the operable controls on the UI interface based on the user's pressure operation on the display unit 1440. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

[0182] An optical sensor is used to collect ambient light intensity. In one embodiment, the first processor 1480 can control the display brightness of the display unit 1440 based on the ambient light intensity collected by the optical sensor. Specifically, when the ambient light intensity is high, the display brightness of the display unit 1440 is increased; when the ambient light intensity is low, the display brightness of the display unit 1440 is decreased. In another embodiment, the first processor 1480 can also dynamically adjust the shooting parameters of the camera assembly 1410 based on the ambient light intensity collected by the optical sensor.

[0183] In this embodiment, the first processor 1480 included in the terminal can execute the word path determination method of the previous embodiment.

[0184] The electronic device provided in this disclosure for executing the above-described word path determination method can also be a server, see below. Figure 15 , Figure 15 This is a partial structural block diagram of a server provided in an embodiment of the present disclosure. The server can vary significantly due to differences in configuration or performance. It may include one or more second processors 1510 and second memories 1530, and one or more storage media 1540 (e.g., one or more mass storage devices) for storing application programs 1543 or data 1542. The second memories 1530 and storage media 1540 may be temporary or persistent storage. The program stored in the storage media 1540 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server. Furthermore, the second processor 1510 may be configured to communicate with the storage media 1540 and execute the series of instruction operations stored in the storage media 1540 on the server.

[0185] The server may also include one or more secondary power supplies 1520, one or more wired or wireless network interfaces 1550, one or more input / output interfaces 1560, and / or one or more operating systems 1541, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0186] The second processor 1510 in the server can be used to execute the word grouping path determination method.

[0187] This disclosure also provides a computer-readable storage medium for storing a computer program for executing the word path determination method of the foregoing embodiments.

[0188] This disclosure also provides a computer program product comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the word path determination method described above.

[0189] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in this disclosure and the foregoing drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate to describe embodiments of this disclosure, for example, those that can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatuses.

[0190] It should be understood that in this disclosure, "at least one item" means one or more, and "more than one" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0191] It should be understood that in the description of the embodiments disclosed herein, "multiple" means two or more, "greater than", "less than", "exceeding" etc. are understood to exclude the number itself, and "above", "below", "within" etc. are understood to include the number itself.

[0192] In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0193] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0194] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0195] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0196] It should also be understood that the various implementation methods provided in this disclosure can be combined arbitrarily to achieve different technical effects.

[0197] The above is a detailed description of the preferred embodiments of this disclosure. However, this disclosure is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this disclosure. All such equivalent modifications or substitutions are included within the scope defined by the claims of this disclosure.

Claims

1. A method for determining word formation paths, characterized in that, include: Obtain the target sequence of the current input, and determine a first subsequence and a second subsequence in the target sequence, wherein the second subsequence includes syllables located before and adjacent to the changed syllables, the changed syllables being the syllables in the target sequence that produce the input change, and the first subsequence includes all syllables located before the second subsequence; Read the intermediate state data corresponding to the first sub-sequence, wherein the intermediate state data is output by the target model and pre-saved when the target model predicts the second word node of the second sub-sequence based on the first word node of the first sub-sequence; The target model is invoked to predict the third character node located after the second character node based on the intermediate state data and the second character node, and the word formation path of the target sequence is determined based on the first character node, the second character node, and the third character node.

2. The word formation path determination method according to claim 1, characterized in that, Determining the first subsequence and the second subsequence in the target sequence includes: Determine the first sequence length of the altered syllables, and determine the second sequence length of the target sequence; The incremental position is determined in the target sequence based on the difference between the length of the second sequence and the length of the first sequence, and the first subsequence and the second subsequence are determined in the target sequence based on the incremental position.

3. The word formation path determination method according to claim 2, characterized in that, Determining the incremental position in the target sequence based on the difference between the length of the second sequence and the length of the first sequence includes: When the changed syllable is the last syllable in the target sequence, the difference between the length of the second sequence and the length of the first sequence is used as the incremental position in the target sequence; Alternatively, when the changed syllable is any syllable in the target sequence other than the first and last syllables, the sum of the lengths of all syllable sequences following the changed syllable is determined to obtain a third sequence length. A fourth sequence length is obtained based on the sum of the first sequence length and the third sequence length. The incremental position in the target sequence is determined based on the difference between the second sequence length and the fourth sequence length.

4. The word formation path determination method according to claim 3, characterized in that, When the altered syllable is the last syllable in the target sequence, determining the first sequence length of the altered syllable includes: In the target sequence, a first position that generates the input change is determined. When the first position is the last position in the target sequence, a second position is searched forward from the first position until the second position and the first position form the longest complete syllable, thus obtaining the changed syllable. The first sequence length of the changed syllable is determined based on the first position and the second position. Alternatively, a first position in the target sequence that generates the input change is determined. When the first position is any position in the target sequence other than the first and last positions, a second position is searched forward from the first position until the second position and the last position in the target sequence form the longest complete syllable, thus obtaining the changed syllable. The first sequence length of the changed syllable is determined based on the second position and the last position in the target sequence.

5. The word formation path determination method according to claim 2, characterized in that, Determining the first subsequence and the second subsequence in the target sequence based on the incremental position includes: Based on the incremental position, a target subsequence is determined in the target sequence; A second subsequence is determined based on the target syllable in the target subsequence, and the portion of the target subsequence other than the second subsequence is taken as the first subsequence, wherein the target syllable is the last syllable in the target subsequence.

6. The word formation path determination method according to claim 5, characterized in that, The step of determining the second subsequence based on the target syllables in the target subsequence includes: Determine the change state of the target syllable following the changed syllable, wherein the change state is used to indicate that the target syllable changes in accordance with the changed syllable, or to indicate that the target syllable does not change in accordance with the changed syllable; When the change state indicates that the target syllable changes in accordance with the changed syllable, the changed target syllable is taken as the second subsequence; or, when the change state indicates that the target syllable does not change in accordance with the changed syllable, the target syllable is taken as the second subsequence.

7. The word formation path determination method according to claim 1, characterized in that, The intermediate state data includes a first embedding representation of the first word node, and the step of calling the target model to predict a third word node located after the second word node based on the intermediate state data and the second word node includes: The target model is called to encode the second word node to obtain the second embedding representation of the second word node. The first embedding representation and the second embedding representation are concatenated to obtain the target embedding representation. The target embedding representation is then decoded to obtain the first probability distribution of the third word node located after the second word node. The third word node is determined based on the first probability distribution.

8. The word formation path determination method according to claim 7, characterized in that, The intermediate state data also includes the second probability distribution of the second word node. The step of calling the target model to encode the second word node to obtain the second embedding representation of the second word node includes: Obtain all fourth-character nodes under the second subsequence and input the fourth-character nodes into the target model; Based on the second probability distribution, the second word node is selected from the fourth word node, and the second word node is encoded to obtain the second embedding representation of the second word node.

9. The word formation path determination method according to claim 7, characterized in that, The word grouping path determination method also includes: Obtain the target embedding representation output by the target model and save the target embedding representation.

10. The word formation path determination method according to claim 9, characterized in that, Saving the target embedding representation includes: Hash processing is performed based on the target embedding representation to generate a first verification value; The third word node, the target embedding representation, and the first check value are associated and saved.

11. The word path determination method according to any one of claims 1 to 10, characterized in that, The method for determining the word path, which involves calling the target model based on the intermediate state data and the second character node prediction, is located before the third character node after the second character node. Based on the first word node, the intermediate state data is retrieved, and the second verification value is generated when the intermediate state data is pre-saved; The intermediate state data obtained from the retrieval is hashed to generate a third verification value, and the third verification value is matched with the second verification value for consistency.

12. A word formation path determination device, characterized in that, include: A sequence determination module is used to obtain the target sequence of the current input, and determine a first subsequence and a second subsequence in the target sequence, wherein the second subsequence includes syllables located before and adjacent to the changed syllables, the changed syllables being syllables in the target sequence that produce input changes, and the first subsequence includes all syllables located before the second subsequence; The data reading module is used to read the intermediate state data corresponding to the first sub-sequence, wherein the intermediate state data is output by the target model and pre-saved when the target model predicts the second word node of the second sub-sequence based on the first word node of the first sub-sequence; The path determination module is used to call the target model to predict the third character node located after the second character node based on the intermediate state data and the second character node, and to determine the word formation path of the target sequence based on the first character node, the second character node and the third character node.

13. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the word path determination method according to any one of claims 1 to 11.

14. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the word path determination method according to any one of claims 1 to 11.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the word path determination method according to any one of claims 1 to 11.