Method of text generation and system thereof

The integration of general-purpose and domain-specific language models in the proposed method addresses the challenges of jargon and code-switching, enhancing text generation accuracy and reducing error rates by predicting words based on source model probabilities, effectively handling specialized domains and mixed languages.

WO2024184873A1PCT designated stage expired Publication Date: 2024-09-12AIOLA LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/IL2023/050672
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-07
Filing Date
2023-06-29
Publication Date
2024-09-12

AI Technical Summary

Technical Problem

General-purpose language models struggle with domain-specific jargon and code-switching, leading to increased error rates in text generation tasks, particularly in specialized fields like medicine, law, and industrial domains, as they lack training data for exclusive jargon and fail to accurately handle mixed language sentences.

Method used

A method and system that integrate multiple language models, alternating between general-purpose and domain-specific models to predict text, where each word is associated with its source model based on probability scores, allowing for accurate domain-specific term recognition and handling of code-switching.

Benefits of technology

This approach significantly reduces word error rates and preserves domain-specific information, improving text generation accuracy in specialized domains while leveraging general knowledge, and enhances interpretability by associating predicted words with their source lexicon.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure IL2023050672_12092024_PF_FP_ABST
    Figure IL2023050672_12092024_PF_FP_ABST
Patent Text Reader

Abstract

There is provided a system and method of text generation. The method includes obtaining an input sequence representing probability distribution of possible tokens at different steps in a sequential order; and processing the input sequence in accordance with the sequential order using a plurality of language models (LMs) respectively trained for specific domains, so as to generate an output sequence representing a predicted text portion corresponding to the input sequence. The output sequence comprises a sequence of words. Each given word is predicted at least based on a word score provided by a source LM from the plurality of LMs and associated with an indication of the source LM. The source LM corresponds to a specific domain where the given word is probable to appear. The output sequence has the highest sequence score computed based on the word score of each word in the output sequence.
Need to check novelty before this filing date? Find Prior Art

Description

METHOD OF TEXT GENERATION AND SYSTEM THEREOFTECHNICAL FIELD

[0001] The presently disclosed subject matter relates, in general, to the field of text generation, and more specifically, to machine learning based text prediction.BACKGROUND

[0002] Generative Artificial Intelligence (Al) is a type of Al technology that can create a wide variety of contents, including text, imagery, audio, and video, etc. Generative Al models learn patterns and structure from input training data, and generate new data that has similar characteristics. Recent advancements in this field, such as language models (LMs), in particular large language models (LLMs), have shown remarkable performance in content generation, classification, and other natural language processing (NLP) tasks.

[0003] By way of example, LLMs, as a type of LM, refer to Al algorithms that use deep learning techniques and large data sets to understand, summarize, generate, and predict new content. Having a large number of parameters trained on massive quantities of textual data, LLMs are able to understand and generate content rapidly, which makes them increasingly popular and broadly applicable across many different domains. By way of example, a range of NLP tasks that may employ LLMs includes text generation, translation, content summary, rewriting, classification, and analysis, etc.

[0004] LMs that are trained on a generic corpus of data and capable of providing responses for general use cases, are referred to as general-purpose LMs. General- purpose LMs often lack the ability to handle domain-specific jargon and terminology commonly used in many specialized fields and professional domains, such as medicine, law, business, health, and / or industrial domains. Jargon language plays a vital role in various fields and real-world applications, enabling experts or professionals to communicate accurately and effectively. Nevertheless, jargon language poses significant challenges for machine learning models such as automatic speech recognition (ASR) and NLP systems. While some jargon words and sentences may be publicly accessible (e.g., flight control or medical terms), many jargon words02946369\37-01are used exclusively within industrial companies. As a result, they are not available for training general-purpose language models.

[0005] Similarly, general-purpose LMs cannot effectively address code-switching (CS) between languages. Code switching refers to shifting between different languages within a single utterance (e.g., code-switch from Spanish to English). Code-switching is a challenging task for machine learning models for ASR and machine translation. Even LMs, which are trained on voluminous amounts of data, will hardly encounter examples of code-switching during training. Moreover, even if there are some available instances of code-switching, these cannot reliably estimate the word probability distribution of the secondary language.

[0006] The above poses a significant challenge for language processing tasks, such as text generation operating in these environments. When a general-purpose LM is used to process data including terms from one of those domains, the LM might perform poorly with increased error rate.

[0007] Thus, there is a need in the art for an improved system and method for dealing with the abovementioned challenges.GENERAL DESCRIPTION

[0008] In accordance with certain aspects of the presently disclosed subject matter, there is provided a computerized method of text generation, comprising: obtaining an input sequence representing probability distribution of possible tokens at different steps in a sequential order; and processing the input sequence in accordance with the sequential order using a plurality of language models (LMs) respectively trained for specific domains, so as to generate an output sequence representing a predicted text portion corresponding to the input sequence, wherein the output sequence comprises a sequence of words, each given word being predicted at least based on a word score provided by a source LM from the plurality of LMs and associated with an indication of the source LM, the source LM corresponding to a specific domain where the given word is probable to appear, and the output sequence has the highest sequence score computed based on the word score of each word in the output sequence.02946369\37-01

[0009] In addition to the above features, the method according to this aspect of the presently disclosed subject matter can comprise one or more of features (i) to (xii) listed below, in any desired combination or permutation which is technically possible:(i). The input sequence is a score matrix comprising scores representing the probability distribution of possible tokens at different steps, and each given word is predicted based on one or more scores of one or more tokens constituting the given word and the word score.(ii). The sequential order is a time series, and the input sequence is a score matrix comprising scores representing the probability distribution of possible tokens at different time steps in the time series. The probability matrix is generated by an acoustic model from an input speech utterance spoken during the time series. The output sequence represents a predicted text transcription corresponding to the input speech utterance.(iii). The plurality of LMs comprises at least a first LM previously trained using general language corpus and a second LM previously trained using domainspecific language corpus. The sequence of words in the output sequence comprises one or more general words predicted by the first LM and associated with the indication thereof, and / or one or more domain-specific words predicted by the second LM and associated with the indication thereof.(iv). The plurality of LMs comprises at least a first LM previously trained using a first language corpus and a second LM previously trained using a second language corpus. The sequence of words in the output sequence comprises one or more words from the first language predicted by the first LM and associated with the indication thereof, and / or one or more domain-specific words predicted by the second LM and associated with the indication thereof.(v). The processing is performed step by step using a search algorithm in a search space, comprising: at a given step, deriving one or more candidate words to be included in one or more candidate sequences, each given candidate word predicted based on a word score by a source LM thereof, the word score causing a respective candidate sequence that includes the given candidate word to have relatively high sequence score at the given step, and associating each02946369\37-01given candidate word with the indication of the source LM thereof. Upon completion of processing the input sequence, the output sequence is selected as a candidate sequence that has the highest sequence score among the one or more candidate sequences.(vi). The processing is performed step by step using beam search with a beam width n. Each LM of the plurality of LMs is assigned with a specific indication thereof. The possible tokens from the input sequence are respectively associated with the plurality of LMs and specific indications thereof. The processing comprises: at a given step in the input sequence, appending possible tokens of the given step the input sequence respectively associated with the plurality of LMs to each given candidate sequence of n candidate sequences resulting from a preceding step, giving rise to possible candidate sequences for the given step; computing a sequence score for each possible candidate sequence by aggregating a score of an appended token, and a word score of a candidate word or sub -word formed by the appending, with the sequence score of the candidate sequence resulting from the preceding step, the word score provided by a source LM corresponding to a copy that the appended token is associated with; and selecting n possible candidate sequences with n highest sequence scores to be the n candidate sequences for the given step.(vii). In cases where an appended token at the given step represents a whitespace indicative of completion of a candidate word which has at least one preceding candidate word predicted by the same source LM in a possible candidate sequence, the word score of the candidate word provided by the source LM is based on the at least one preceding candidate word.(viii). In cases the given step is within a word, the appending comprises appending possible tokens of the given step that a preceding token is associated with.(ix). The indication of the source LM is a specific visual representation to be associated with a word predicted by the source LM.02946369\37-01(x). The indication of the source LM is a specific color to be associated with a word predicted by the source LM, and each word in the sequence of words of the output sequence is respectively colored with a specific color of the source LM thereof.(xi). The method further comprises filtering the output sequence by filtering out one or more words associated with an indication of a specific LM.(xii). The output sequence has a reduced word error rate with respect to an output sequence provided by interpolating over the plurality of LMs.

[0010] In accordance with other aspects of the presently disclosed subject matter, there is provided a system of text generation, the system comprising a processing circuitry configured to obtain an input sequence representing probability distribution of possible tokens at different steps in a sequential order; and process the input sequence in accordance with the sequential order using a plurality of language models (LMs) respectively trained for specific domains, so as to generate an output sequence representing a predicted text portion corresponding to the input sequence, wherein the output sequence comprises a sequence of words, each given word being predicted at least based on a word score provided by a source LM from the plurality of LMs and associated with an indication of the source LM, the source LM corresponding to a specific domain where the given word is probable to appear, and the output sequence has the highest sequence score computed based on the word score of each word in the output sequence.

[0011] This aspect of the disclosed subject matter can comprise one or more of features (i) to (xii) listed above with respect to the method, mutatis mutandis, in any desired combination or permutation which is technically possible.

[0012] In accordance with other aspects of the presently disclosed subject matter, there is provided a non-transitory computer readable medium comprising instructions that, when executed by a computer, cause the computer to perform a method of text generation, the method comprising: obtaining an input sequence representing probability distribution of possible tokens at different steps in a sequential order; and processing the input sequence in accordance with the sequential order using a plurality of language models (LMs) respectively trained for specific domains, so as to generate02946369\37-01an output sequence representing a predicted text portion corresponding to the input sequence, wherein the output sequence comprises a sequence of words, each given word being predicted at least based on a word score provided by a source LM from the plurality of LMs and associated with an indication of the source LM, the source LM corresponding to a specific domain where the given word is probable to appear, and the output sequence has the highest sequence score computed based on the word score of each word in the output sequence.

[0013] This aspect of the disclosed subject matter can comprise one or more of features (i) to (xii) listed above with respect to the method, mutatis mutandis, in any desired combination or permutation which is technically possible.BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to understand the disclosure and to see how it may be carried out in practice, embodiments will now be described, by way of non-limiting example only, with reference to the accompanying drawings, in which:

[0015] Fig. 1 illustrates a functional block diagram of a text prediction system in accordance with certain embodiments of the presently disclosed subject matter.

[0016] Fig. 2 illustrates a generalized flowchart of text generation in accordance with certain embodiments of the presently disclosed subject matter.

[0017] Fig. 3 illustrates a generalized flowchart of processing the input sequence in accordance with certain embodiments of the presently disclosed subject matter.

[0018] Fig. 4 illustrates a generalized flowchart of an exemplary processing using beam search in accordance with certain embodiments of the presently disclosed subject matter.

[0019] Fig. 5 illustrates exemplified score calculation in accordance with certain embodiments of the presently disclosed subject matter.

[0020] Fig. 6 illustrates an example of an input sequence in accordance with certain embodiments of the presently disclosed subject matter.02946369\37-01

[0021] Fig. 7 illustrates an exemplary beam search process based on the input sequence of Fig. 6 in accordance with certain embodiments of the presently disclosed subject matter.

[0022] Fig. 8 illustrates an exemplary algorithm describing the modification to the standard Connectionist Temporal Classification (CTC) beam search algorithm in accordance with certain embodiments of the presently disclosed subject matter.

[0023] Fig. 9 illustrates an evaluation of the proposed method with respect to other methods of combining LMs in accordance with certain embodiments of the presently disclosed subject matter.DETAILED DESCRIPTION OF EMBODIMENTS

[0024] In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the disclosure. However, it will be understood by those skilled in the art that the presently disclosed subject matter may be practiced without these specific details. In other instances, well-known methods, procedures, components and circuits have not been described in detail so as not to obscure the presently disclosed subject matter.

[0025] Unless specifically stated otherwise, as apparent from the following discussions, it is appreciated that throughout the specification discussions utilizing terms such as "obtaining", "generating", “processing”, “predicting”, “computing”, “representing”, “training”, “deriving”, "associating", "duplicating", "aggregating", “appending”, “selecting”, “providing”, “coloring”, “filtering” or the like, refer to the action(s) and / or process(es) of a computer that manipulate and / or transform data into other data, said data represented as physical, such as electronic, quantities and / or said data representing the physical objects. The term “computer” should be expansively construed to cover any kind of hardware-based electronic device with data processing capabilities including, by way of non-limiting example, the system of text generation, the processing circuitry, and respective parts thereof disclosed in the present application.

[0026] The terms " non-transitory computer-readable memory" and “non-transitory computer-readable storage medium” used herein should be expansively construed to cover any volatile or non-volatile computer memory suitable to the presently disclosed 02946369\37-01subject matter. The terms should be taken to include a single medium or multiple media (e.g., a centralized or distributed database, and / or associated caches and servers) that store the one or more sets of instructions. The terms shall also be taken to include any medium that is capable of storing or encoding a set of instructions for execution by the computer and that cause the computer to perform any one or more of the methodologies of the present disclosure. The terms shall accordingly be taken to include, but not be limited to, a read only memory (“ROM”), random access memory (“RAM”), magnetic disk storage media, optical storage media, flash memory devices, etc.

[0027] Embodiments of the presently disclosed subj ect matter are not described with reference to any particular programming language. It will be appreciated that a variety of programming languages may be used to implement the teachings of the presently disclosed subject matter as described herein.

[0028] As used herein, the phrase "for example," "such as", "for instance" and variants thereof describe non-limiting embodiments of the presently disclosed subject matter. Reference in the specification to "one case", "some cases", "other cases" or variants thereof means that a particular feature, structure, or characteristic described in connection with the embodiment s), is included in at least one embodiment of the presently disclosed subject matter. Thus, the appearance of the phrase "one case", "some cases", "other cases", or variants thereof, does not necessarily refer to the same embodiment(s).

[0029] It is appreciated that, unless specifically stated otherwise, certain features of the presently disclosed subject matter, which are described in the context of separate embodiments, can also be provided in combination in a single embodiment. Conversely, various features of the presently disclosed subject matter, which are described in the context of a single embodiment, can also be provided separately or in any suitable sub-combination. In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the methods and apparatus.

[0030] In embodiments of the presently disclosed subject matter, one or more stages illustrated in the figures may be executed in a different order and / or one or more groups of stages may be executed simultaneously, and vice versa.02946369\37-01

[0031] As described above, with the evolution of LMs that dramatically expands the capabilities of Al models, LMs have become increasingly popular and broadly applicable across many different domains. However, incorporating and understanding words and terms from underrepresented specific domains in the training data still pose a significant challenge for LMs. Such a challenge naturally arises in jargon language, where speakers use specialized terms or expressions specific to a field or profession, and in code-switching, where speakers switch between languages within a sentence or discourse. Jargon terms are rare in publicly accessible resources, thus are generally less available for training the general-purpose LMs.

[0032] In some cases, a technique called domain adaptation is used, where the pretrained general-purpose LMs undergo additional training steps using domainspecific data, such as, e.g., legal documents or medical papers, such that the LMs can be adapted to specific fields like scientific, medical, legal, or financial domains.

[0033] Alternatively, another common approach to address this challenge is to interpolate over multiple language models, each responsible for a different domain and trained on a different corpus. However, this approach suffers from a few major drawbacks. First, it assumes fixed interpolation coefficients, which may be sub- optimal and not allow to capture the variability of natural languages. Second, it fails to account for domain-switching or code-switching within a sentence, as mixed sentences assign low probabilities under the different LMs. Third, the averaging of several LMs may result in an over-smoothing effect, in which domain-specific terms that are more likely to occur in a certain domain or application may be assigned lower probabilities than their true values. Hence, the interpolation approach may lead to the degradation of domain-specific information which is crucial for many applications, such as, e.g., automatic speech recognition (ASR) applications.

[0034] Take ASR as an example, ASR refers to the recognition and translation of spoken language into text by computers. ASR has seen significant advancements in recent years, with the development of self-supervised representation techniques and acoustic models resulting in remarkable improvements in performance. ASR predicts text by combining an acoustic model (AM) and a language model (LM). However, accurate language modeling is critical for achieving high accuracy rates in ASR systems. In particular, domain-specific jargon, used in specialized fields such as02946369\37-01medicine, law, and industrial domains, presents a significant challenge to ASR systems, which often fail to recognize domain-specific jargon terms accurately.

[0035] Accordingly, certain embodiments of the presently disclosed subject matter propose a system and method for optimized text generation / prediction based on language models, which does not have one or more of the disadvantages described above. The present disclosure proposes to integrate multiple LMs, such as integrating a domain-specific LM(s) and a general-purpose LM. Specifically, it is proposed to alternate between the general and domain-specific LMs by selecting the most plausible LM at each given time, thus alleviating the major drawbacks with respect to the interpolation approaches as described above. This allows to preserve domain-specific information while leveraging the general knowledge of the pre-trained general- purpose LM. The proposed method can be adapted to support multiple domains and specialized jargons, with the ability to associate predicted words with their source lexicon, as will be detailed below.

[0036] Bearing this in mind, attention is drawn to Fig. 1 illustrating a functional block diagram of a text generation system in accordance with certain embodiments of the presently disclosed subject matter.

[0037] The system 100 illustrated in Fig. 1 is a computer-based system that can be used for text generation or prediction. Text generation or prediction can be broadly interpreted as the process of creating new text for any language processing applications with the assistance of one or more language models. This can be done for a variety of purposes, such as, e.g., creating new content, translating languages, automatic speech recognition (ASR), or generating creative text formats, etc. According to certain embodiments of the presently disclosed subject matter, given an input sequence representing probability distribution of possible tokens at different points / steps in a sequential order, the system 100 can be configured to generate, with the assistance of language models, an output sequence comprising a predicted text portion corresponding to the input sequence, as will be described below in further detail with reference to Figs. 2-5. System 100 is thus also referred to as a text generation system or a text prediction system in the present disclosure.

[0038] System 100 can be employed for various language processing applications. One example of such applications is speech recognition, such as used in ASR systems. 02946369\37-01As described above, ASR refers to the recognition and translation of spoken language into text. In ASR systems, an acoustic model is used for predicting the probability of a sequence of tokens (e.g., phonemes or other linguistic units that make up speech) given an audio signal. The acoustic model can be typically trained on a large corpus of speech data (such as audio recordings) and their corresponding transcripts. It is learnt to estimate the likelihood of a given token being spoken based on the acoustic features of the audio signal.

[0039] According to certain embodiments, optionally, an acoustic model 120 can be comprised as a component of system 100, as illustrated in Fig. 1. System 100 in such cases can be regarded as an ASR system.

[0040] System 100 includes a processing circuitry 102 operatively connected to the acoustic model 120. The processing circuitry 102 is configured to provide all processing necessary for operating the system 100 as further detailed with reference to Figs 2 and 3. The processing circuitry 102 can be regarded as comprising one or more processors (not shown separately) and one or more memories (not shown separately). The one or more processors of the processing circuitry 102 can be configured to, either separately or in any appropriate combination, execute several functional modules in accordance with computer-readable instructions implemented on a non-transitory computer-readable memory comprised in the processing circuitry. Such functional modules are referred to hereinafter as comprised in the processing circuitry.

[0041] The one or more processors referred to herein can represent one or more general-purpose processing devices such as a microprocessor, a central processing unit, or the like. More particularly, a given processor may be one of a complex instruction set computing (CISC) microprocessor, a reduced instruction set computing (RISC) microprocessor, a very long instruction word (VLIW) microprocessor, a processor implementing other instruction sets, or a processor implementing a combination of instruction sets. The one or more processors may also be one or more special-purpose processing devices such as an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a digital signal processor (DSP), a network processor, or the like. The one or more processors are configured to execute instructions for performing the operations and steps discussed herein.02946369\37-01

[0042] The memories referred to herein can comprise one or more of the following: internal memory, such as, e.g., processor registers and cache, etc., main memory such as, e.g., read-only memory (ROM), flash memory, dynamic random access memory (DRAM) such as synchronous DRAM (SDRAM), or Rambus DRAM (RDRAM), etc.

[0043] In certain embodiments, functional modules comprised in processing circuitry 102 can include a decoder module 106 operatively connected to a plurality of language models. By way of example, a first language model (LM) 104 and a second language model (LM) 108 are illustrated in Fig. 1 for exemplary purposes. The processing circuitry 102 can be configured to obtain an input sequence representing probability distribution of possible tokens at different steps in a sequential order. The decoder module 106 can be configured to process the input sequence in accordance with the sequential order using a plurality of language models (LMs) (such as, e.g., the first LM 104 and the second LM 108) respectively trained for specific domains, so as to generate an output sequence representing a predicted text portion corresponding to the input sequence. The plurality of LMs are pre-trained ML models. The output sequence comprises a sequence of words, where each word is predicted at least based on a word score provided by a source LM from the plurality of LMs and is associated with an indication of the source LM. The source LM for predicting the given word corresponds to a specific domain where the given word is probable to appear. In other words, each given word is predicted by a selected most plausible LM directed to a specific domain that the word belongs to. The output sequence has the highest sequence score which is computed based on the word score of each word in the output sequence.

[0044] Operation of system 100, processing circuitry 102 and the functional modules therein will be further detailed with reference to Figs. 2-5.

[0045] It is to be noted that while certain embodiments of the present disclosure refer to the processing circuitry 102 being configured to perform the above recited operations, the functionalities / operations of the aforementioned functional modules can be performed by the one or more processors in processing circuitry 102 in various ways. By way of example, the operations of each functional module can be performed by a specific processor, or by a combination of processors. The operations of the various functional modules, such as the detailed processing of the input sequence, can02946369\37-01thus be performed by respective processors (or processor combinations) in the processing circuitry 102, while, optionally, these operations may be performed by the same processor. The present disclosure should not be limited to being construed as one single processor always performing all the operations.

[0046] According to certain embodiments, the language models referred to herein can be implemented as various types of machine learning models. The learning algorithm used by the language models can be any of the following, or a combination thereof supervised learning, unsupervised learning, self-supervised learning, or semisupervised learning, etc. The presently disclosed subject matter is not limited to the specific type or learning algorithm used by the ML model.

[0047] In some embodiments, the language models referred to herein can be implemented as a deep neural network (DNN) which includes layers organized in accordance with respective DNN architecture. By way of non-limiting example, the layers of DNN can be organized in accordance with transformers, Convolutional Neural Network (CNN), Recurrent Neural Network, Recursive Neural Networks, or otherwise, depending on the specific task that the model is trained to perform. Optionally, at least some of the layers can be organized in a plurality of DNN subnetworks. Each layer of DNN can include multiple basic computational elements (CE) typically referred to in the art as dimensions, neurons, or nodes.

[0048] The weighting and / or threshold values associated with the CEs of a deep neural network and the connections thereof can be initially selected prior to training, and can be further iteratively adjusted or modified during training, to achieve an optimal set of weighting and / or threshold values in a trained DNN. After each iteration, a difference can be determined between the actual output produced by the DNN module and the target output associated with the respective training set of data. The difference can be referred to as an error value. Training can be determined to be complete when a loss / cost function indicative of the error value is less than a predetermined value, or when a limited change in performance between iterations is achieved. A set of input data used to adjust the weights / thresholds of a deep neural network is referred to as a training set.02946369\37-01

[0049] It is noted that the above illustrated architectures are for exemplary purposes only, and the teachings of the presently disclosed subject matter are not bound by the specific model and architecture as described above.

[0050] According to certain embodiments, system 100 can comprise a storage unit 122. The storage unit 122 can be configured to store any data necessary for operating system 100, e.g., data related to input and output of system 100, as well as intermediate processing results generated by system 100. By way of example, the storage unit 122 can be configured to store the input sequence and the output sequence. The storage unit 122 can also be configured to store the pre-trained LMs. Accordingly, these data and / or models can be retrieved from the storage unit 122 and provided to the processing circuitry 102 for further processing.

[0051] In some embodiments, system 100 can optionally comprise a computer-based graphical user interface (GUI) 124 which is configured to enable user-specified inputs related to system 100. The user may be provided, through the GUI, with options of defining certain operation parameters, such as, e.g., configuration parameters of LMs, beam search parameters, etc. The user may also view the operation results, such as, e.g., the predicted output sequence, on the GUI, and can provide feedback on the prediction through the GUI.

[0052] Those versed in the art will readily appreciate that the teachings of the presently disclosed subject matter are not bound by the system illustrated in Fig. 1. Each system component and module in Fig. 1 can be made up of any combination of software, hardware and / or firmware, as relevant, executed on a suitable device or devices, which perform the functions as defined and explained herein. Equivalent and / or modified functionality, as described with respect to each system component and module, can be consolidated or divided in another manner. Thus, in some embodiments of the presently disclosed subject matter, the system may include fewer, more, modified and / or different components, modules, and functions than those shown in Fig. 1.

[0053] Each component in Fig. 1 may represent a plurality of the particular components, which are adapted to independently and / or cooperatively operate to process various data and electrical inputs, and for enabling operations related to a computerized examination system. In some cases, multiple instances of a component 02946369\37-01may be utilized for reasons of performance, redundancy, and / or availability. Similarly, in some cases, multiple instances of a component may be utilized for reasons of functionality or application. For example, different portions of the particular functionality may be placed in different instances of the component.

[0054] It should be noted that the examination system illustrated in Fig. 1 can be implemented in a distributed computing environment, in which one or more of the aforementioned components and functional modules shown in Fig. 1 can be distributed over several local and / or remote devices. By way of example, the acoustic model 120 and the processing circuitry 102 can be located at the same entity (in some cases hosted by the same device) or distributed over different entities, depending on specific system configurations and implementation needs. In some examples, certain components utilize a cloud implementation, e.g., implemented in a private or public cloud. Communication between the various components of the text generation system, in cases where they are not located entirely in one location or in one physical entity, can be realized by any signaling system or communication components, modules, protocols, software languages, and drive signals, and can be wired and / or wireless, as appropriate.

[0055] It should be further noted that in some embodiments at least some of the acoustic model 120, storage unit 122 and / or GUI 124 can be external to the system 100 and operate in data communication with system 100 via an I / O interface 126. In some cases, the pre-trained language models, or some thereof, can be stored externally and can be obtained and processed by system 100 via I / O interface 126. System 100 can be implemented as stand-alone computer(s) to be used in conjunction with certain language processing systems, as described above. Alternatively, the respective functions of the system 100 can, at least partly, be integrated with such language processing systems, thereby facilitating and enhancing the functionalities of these systems. In some cases, the data repositories or storage unit therein can be shared with other systems or be provided by other systems, including third party equipment.

[0056] While not necessarily so, the process of operation of system 100 can correspond to some or all of the stages of the methods described with respect to Figs. 2-5. Likewise, the methods described with respect to Figs. 2-5 and their possible implementations can be implemented by system 100. It is therefore noted that02946369\37-01embodiments discussed in relation to the methods described with respect to Figs. 2-5 can also be implemented, mutatis mutandis as various embodiments of the system 100, and vice versa.

[0057] Referring to Fig. 2, there is illustrated a generalized flowchart of text generation in accordance with certain embodiments of the presently disclosed subject matter.

[0058] An input sequence can be obtained (202) (e.g., by the decoder module 106 in processing circuitry 102) which comprises scores representing probability distribution of possible tokens at different steps in a sequential order. The tokens represent the basic units to be processed by the decoder, and can be in the form of any of the following: phonemes, characters, letters, or sub-words, depending on the specific applications and / or the vocabulary of the languages. The probabilities represent the likelihood of each token occurring at each step in the sequential order. By way of example, the input sequence can be a score matrix comprising scores representing the probability distribution of possible tokens at different steps in the sequential order.

[0059] It is to be noted that the term “score” used in the present disclosure can refer to any score representing the probability that a language unit, such as a token as described above, or a word (or sub-word) or a sequence as will be described below, is likely to appear at a given step. The score can be computed based on different methodologies from different language processing applications, and the present disclosure is not limited to a specific representation of such scores. By way of example, the scores can be represented in the form of probability scores.

[0060] By way of example, in cases of ASR systems, an acoustic model (such as the acoustic model 120 in Fig. 1) is used to estimate the likelihood of a given token being spoken at a given time point based on the acoustic features of an input audio signal. The output of the acoustic model may be in the form of a score matrix, where each column of the matrix corresponds to a time step (such as, e.g., a time frame) in a time series and each row corresponds to a particular phoneme or sub-word. The values in the matrix are the scores representing probabilities of each phoneme, character, or subword occurring at each time step in the input audio signal. By way of example, in cases where the scores are in the form of probability scores, the output of the acoustic model can be in the form of a probability matrix.02946369\37-01

[0061] The decoder module can be configured to take the output of the acoustic model and search through the space of possible text transcriptions, taking into account the probability of each word occurring in the language, as well as the probability of each word following another word (i.e., context of the words), as provided by the language models, for the purpose of finding the most likely sequence of words or sentences that best matches the input.

[0062] The decoder can explore different paths through the search space by considering various candidate combinations of tokens, sub-words, and words, and evaluating their probabilities based on the input sequence (e.g., the probability matrix from the acoustic model) and the language models. It applies various search algorithms to efficiently explore the search space and find the most probable transcription. By way of example, the applicable search algorithms can include beam search, greedy search, or dynamic programming algorithms. During decoding, the decoder considers the probabilities from the input sequence at each time step, while incorporating language model scores that capture the likelihood of specific word sequences.

[0063] Specifically, the input sequence as described above can be processed (204) (e.g., by the decoder module 106) in accordance with the sequential order using a plurality of language models (e.g., the first LM 104 and the second LM 108) respectively trained for specific domains, so as to generate an output sequence representing a predicted text portion corresponding to the input sequence. The output sequence comprises a sequence of words. Each given word is predicted at least based on a word score provided by a source LM from the plurality of LMs and is associated with an indication of the source LM. The word score represents the probability that the given word is likely to appear at a given step of the sequential order. The source LM corresponds to a specific domain where the given word is probable to appear. The output sequence has the highest sequence score computed based on the word score of each word in the output sequence.

[0064] By way of example, the input sequence is a score matrix comprising scores representing the probability distribution of possible tokens at different steps. In such cases, each given word can be predicted based on one or more scores of one or more tokens constituting the given word from the score matrix and the word score, as described below in further detail.02946369\37-01

[0065] The term “word” used herein can be defined as a sequence of characters, letters or graphemes delimited by whitespace or punctuation. Words are considered as the fundamental units of text. In some cases, words can be further broken down into smaller units such as, e.g., sub-words. Sub-words can capture both the morphological and semantic aspects of languages and allow the models to handle out-of-vocabulary words, and / or rare or unseen words more effectively. In some cases, the term “words” can be broadly construed to include not only individual words, but also multi-word expressions, phrases, idioms, or other linguistic units. This interpretation allows the models to capture the compositional nature of language and account for the meaning and syntactic relationships of larger units beyond individual words. In short, words as used in language models can be adapted to accommodate different levels of granularity, from sub-word level, to word-level, and / or multi-word level of linguistic units, and the present disclosure is not limited to prediction of a specific granularity of a word.

[0066] According to certain embodiments, the processing in block 204 can be performed step by step (in accordance with the sequential order) using a search algorithm in a search space (such as, e.g., beam search). Fig. 3 illustrates a generalized flowchart of processing the input sequence in accordance with certain embodiments of the presently disclosed subject matter.

[0067] Specifically, at a given step in the sequential order (such as, e.g., a given time step in the time series), one or more candidate words can be derived (302) to be respectively included / appended in one or more candidate sequences. Each given candidate word is predicted at least based on a word score by a source LM. As described above, the source LM is of a specific domain where the given candidate word is likely / probable to appear (e.g., the specific domain of the source LM is associated with a domain lexicon that the given candidate word is likely to belong to). The word score of the candidate word causes a respective candidate sequence that includes the given candidate word to have a relatively high sequence score to be selected at the given step. Similarly, each given candidate word can be predicted based on one or more scores of one or more tokens constituting the given candidate word from the score matrix and the word score of the given candidate word.02946369\37-01

[0068] Each given candidate word can be associated (304) with the specific indication of the source LM thereof. In some embodiments, the specific indication associated with a source LM can be a specific visual representation assigned to the source LM, such as, e.g., a specific color or font to be associated with the words predicted by the source LM. By way of example, the indication of a source LM can be a specific color to be associated with a word predicted by the source LM. In such cases, each word in the sequence of words of the output sequence can be respectively colored with a specific color of the source LM thereof. Alternatively, the indication of a source LM can be a specific font, style or effect applied to the words, such as, e.g., bolded, italic, underlined, with added symbols, or any combination thereof etc.

[0069] Upon completion of processing the input sequence (e.g., finishing processing the last step in the sequential order), a candidate sequence that has the highest sequence score among the one or more candidate sequences can be selected (306) as the output sequence. In some cases, the output sequence can be filtered by filtering out one or more words associated with an indication of a specific LM, such as, e.g., the words colored with a specific color of a given LM.

[0070] In some embodiments, the plurality of LMs can comprise at least a first LM previously trained for a general-purpose domain using a general language corpus, and a second LM previously trained for a specific domain using a domain-specific language corpus (e.g., such as in the legal or medical domain). In such cases, the sequence of words in the output sequence may comprise one or more general words predicted by the first LM and associated with the indication thereof, and / or one or more domain-specific words predicted by the second LM and associated with the indication thereof. The general words and the specific words may alternate in the output sequence with their associated indications, such as colors.

[0071] In some embodiments, the plurality of LMs can comprise at least a first LM previously trained using a first language corpus (such as, e.g., English) and a second LM previously trained using a second language corpus (such as, e.g., French). In such cases, the sequence of words in the output sequence may comprise one or more words from the first language predicted by the first LM and associated with the specific indication thereof, and / or one or more words from the second language predicted by the second LM and associated with the specific indication thereof. This is typically the02946369\37-01case in code switching, where a speaker or writer switches back and forth between different languages within a single conversation or communication event.

[0072] Referring now to Fig. 4, there is illustrated a generalized flowchart of an exemplary processing using beam search in accordance with certain embodiments of the presently disclosed subject matter.

[0073] As described above, various search algorithms can be used by the decoder in order to find the most likely output sequence of words that best matches the input sequence. Beam search is one of such algorithms. In beam search, the search space is explored by maintaining a fixed-size set of the most probable partial sequences or candidate sequences, referred to as the beam. The fixed size of the set is referred to as beam width. Beam width refers to the number of candidate sequences that are retained and considered at each step of the search. It determines the size of the beam or the number of paths that are explored in parallel during the decoding process. At each step of the search, the algorithm expands the beam by considering multiple possible tokens to be appended to the beam, and selects the most likely candidate sequences based on a scoring function. The beam is then pruned, keeping only the top-scoring candidates according to the beam width, and discarding the rest.

[0074] Assume the beam search used has a beam width n, indicating n candidate sequences are retained at each step of the search. A specific indication (e.g., a specific color or font) can be assigned (402) to each LM of the plurality of LMs, such that the words predicted by a given LM can be associated (e.g., marked) with the specific indication thereof. The possible tokens from the input sequence can be respectively associated (404) with the plurality of LMs and specific indications thereof. The association between the tokens from the input sequence and the plurality of LMs and indications thereof can be performed in various manners. By way of example, a plurality of copies of the input sequence can be duplicated to correspond to the plurality of LMs, each copy associated with the specific indication of the corresponding LM. By way of example, in cases where the specific indication is a specific color, the copies of the input sequence, such as the possible tokens at various steps, can be colored with the specific color of a corresponding LM.

[0075] At a given step in the input sequence, such as the beginning of a word (e.g., following a preceding step where a whitespace was identified), possible tokens of the 02946369\37-01given step of the input sequence respectively associated with the plurality of LMs can be appended (406) to each given candidate sequence of n candidate sequences resulting from a preceding step, giving rise to possible candidate sequences for the given step. Continuing with the above example, where a plurality of copies of the input sequence are duplicated corresponding to the plurality of LMs, possible tokens of the given step from the multiple copies of the input sequence can be appended respectively to each given candidate sequence of n candidate sequences resulting from the preceding step, giving rise to possible candidate sequences for the given step. If the given step is the first step in the input sequence, the candidate sequences resulting from a preceding step can be regarded as void. If the given step is within a word (e.g., it is not the beginning of a word, or a whitespace indicating the end of a word), only tokens from the same copy as of a token of the preceding step can be appended. In other words, there is no switching between different LMs within a word, and a word should be predicted entirely by one LM.

[0076] A sequence score can be computed (408) for each possible candidate sequence by aggregating a score of an appended token (e.g., as retrieved from the input sequence) and a word score of a candidate word or sub-word formed by the appending (if any) with the sequence score of the candidate sequence resulting from the preceding step. The word score is provided by a source LM (that predicts the word or sub -word) that the appended token is associated with (e.g., a source LM corresponding to a copy that the appended token is from). As n candidate sequences should be retained at each step, n possible candidate sequences with n highest sequence scores can be selected (410) to be the n candidate sequences for the given step.

[0077] The detailed processing using beam search, as described above with reference to Fig. 4, is further exemplified by Figs. 6 and 7. Referring now to Fig. 6, there is illustrated an example of an input sequence in accordance with certain embodiments of the presently disclosed subject matter.

[0078] As illustrated, 600 is an exemplary score matrix resulting from an acoustic model, where each row corresponds to a particular token (e.g., a letter or phoneme in English in the present example), and each column of the matrix corresponds to a time step (t = 1-n) in a time series. The values in the matrix represent the scores of each letter or phoneme representing the probabilities of the letter or phoneme occurring at02946369\37-01each time step in an input speech utterance. In some cases, the scores can be used to compute the probabilities thereof using, e.g., softmax, giving rise to probability scores. For a given time step, the values that are highlighted in the matrix represent relatively higher scores of corresponding letters. By way of example, at time step t=l, the letters that have higher probabilities to be spoken include E and I.

[0079] Fig. 7 illustrates an exemplary beam search process based on the input sequence of Fig. 6 in accordance with certain embodiments of the presently disclosed subject matter.

[0080] Assume the input speech utterance start with “I had intradermal ... ”, and two LMs are used together with a decoder, where the first LM is a general LM, and the second is a domain-specific LM trained using a medical corpus. The two LMs can be pre-assigned with specific indications, such as different coloring, fonts, etc. For purpose of easy illustration in the drawings, the first LM is assigned with regular font, while the second LM is assigned with Italic font plus a sign of *. The beam search used for processing the input sequence has a beam width of 3, indicating 3 candidate sequences are retained at each step of the search.

[0081] As described above with reference to Fig. 4, the input sequence 600 is duplicated to two copies respectively corresponding to the two LMs. Each copy is associated with the specific indication of the corresponding LM. For instance, the letters in the copy of input sequence corresponding to the first LM will be illustrated in regular font, and the letters in the copy of input sequence corresponding to the second LM will be illustrated in Italic font with *.

[0082] At time step t=l, the letters that have the highest scores from the probability matrix 600 include I: 0.95, and E: 0.9, etc. As this is the beginning of a word, as well as the first step in the input sequence, there are no candidate sequences resulting from a preceding step. All possible tokens at time step t=l from the two copies of the input sequence can be considered and three tokens having the highest scores can be selected as the candidate sequences. As the letter I and E have the highest scores, the regular I from the first LM (i.e., LM 1) and the italic I* from the second LM (i.e., LM 2) can be selected. An italic E* with the score of 0.9 is also selected to form the third candidate sequence / beam. Thus, at time step t=l, three candidate sequences are formed, I, I* and E, as illustrated in Fig. 7.02946369\37-01

[0083] At the next time step t=2, the letters that have the highest scores from the probability matrix 600 include I: 0.9, Y: 0.94 and E: 0.8. As this step indicates that it is within a word (e.g., it follows the first time step, and there are no letters such as a whitespace indicating completion of a word), only the possible letters from the same copy that a preceding letter of a candidate sequence is from, should be appended to the candidate sequence, rather than possible letters from all copies. This is for the purpose of ensuring that a word should be predicted entirely by one LM, and there should be no switching between different LMs within a word.

[0084] By way of example, for the candidate sequence I from the time step t=l, only possible letters from the copy of the input sequence for LM 1 should be appended to it. Therefore, the three letters that have the highest scores I, Y, and E with the regular font, should be appended to candidate sequence I, as illustrated. For the candidate sequence / *, only letters from the copy of the input sequence for LM 2 should be appended to it. Therefore, the three letters that have the highest scores / *, Y*, and E* with the regular font should be appended to candidate sequence I*. This is also the case for candidate sequence E*.

[0085] A sequence score can be computed for each possible candidate sequence, e.g., by aggregating a score of an appended letter, as well as a word score of a candidate word or sub-word formed by the appending (if any), with the sequence score of the candidate sequence resulting from the preceding step. In the present case, since the possible candidate sequences do not present a known word or sub-word, the word score can be regarded as none or zero. The sequence score can thus be computed by aggregating the score of the letter from t=l and the current letter appended at t=2. In some cases, optionally, a penalty score can be provided by LMs for candidate sequences which comprise unlikely letter combinations, such as I-Y, andUpon calculating the sequence scores for all possible candidate sequences, in combination with the penalty scores provided by the LMs, three candidate sequences having highest scores at this step can be selected as I-I, / *- / *, and E*-Y* as shown in Fig. 7.

[0086] At the time step t=4, the letters that have the highest scores from the probability matrix 600 include whitespace (also referred to as space): 0.9, A: 0.45 and N: 0.32, where whitespace indicates completion of a word. In such cases, when computing the sequence scores for each possible candidate sequence, a word score of02946369\37-01the formed word should be aggregated together with the score of the appended whitespace and the sequence score of the candidate sequence from the preceding step. The word score of the word is provided by a source LM corresponding to a copy that the letter of the word is from, i.e., the word score is provided by the source LM that predicts it. For instance, the I-I-space forms a word “I”. Assume the word score of “I” in LM 1 is 0.2, the candidate sequence I-I-I-space has a sequence score computed by: 0.95*0.95*0.95*0.2. The / *- / *- / *-whitespace also forms a word “I”. Assume the word score of “I” in LM 2 is 0.01 (as LM 2 is a medical LM where regular common terms are less likely to appear), the candidate sequence / *- / *- / *-whitespace has a sequence score computed by: 0.95*0.95*0.95*0.01. Similarly, the sequence scores for other possible candidate sequences can be computed, and the three candidate sequences having highest scores at this step can be selected as I-I-I-space, I*-I*-I*-space, and E*-Y*-E*-space as shown in Fig. 7. The exemplified score calculation is illustrated in a table denoted as “#1 word iteration” of Fig. 5.

[0087] From the next time step t=5, the first letter of the next word will be selected in a similar manner as described above, so as to result in three candidate sequences having the highest scores. As this is the beginning of a new word, all possible tokens from all copies of the input sequence can be appended to form possible candidate sequences, not only the tokens from the same copy as of the preceding token in a candidate sequence. This is because switching between different LMs can occur between words, but not within a word. As illustrated, three candidate sequences LH (where the I-I-space is combined and illustrated as I), Z*-H and E*Y*E*-H* are selected, where the sequence 7*-H switched from LM 2 to LM 1.

[0088] It is to be noted that at time step t=6, the token of whitespace indicates a completion of a second word. As this word has a preceding word “I”, the word score of the second word is based on the preceding word (e.g., the first word) in the candidate sequence in cases where the first word and the second word are predicted by the same source LM. By way of example, the word score of “had” following “I” as provided by LM 1 has taken into consideration the preceding word “I”, i.e., it should consider the probability that the word “had” follow the word “I” in the general language domain.

[0089] The beam search process can continue in accordance with the time series in a similar manner as described above, so as to expand the beams step by step (for purpose02946369\37-01of brevity of the drawing illustration, Fig. 7 skipped the intermediate time steps). At the last time step t=18 of the input sequence, upon processing the last token, three candidate sequences having highest scores can be selected as “I had intrastate”, “I had intradermal*" and “I has intradermal*". Among the three candidates, the one has the highest score is selected as the output sequence, which is “I had intradermal”, as shown in the score calculation in a table denoted as “#3 word iteration” of Fig. 5.

[0090] It is to be noted that Fig. 7 exemplifies a simplified scenario for the purpose of illustrating how beam search works for implementing the presently disclosed subject matter. By way of example, in some cases, a sub-word may appear when appending certain tokens, such as, e.g., in the form of a prefix, suffix, or a combining form of a word into another word, etc. When such sub-words are identified by a LM, the LM can provide word scores for these sub-words, which can be aggregated together with the scores of the tokens / letters in the candidate sequences. For instance, when a beam expands to form the prefix “intra-” such as in the word “intradermal” at a given time step, if such prefix is identified in LM 1 and LM 2, LM 1 and LM 2 can provide a corresponding word score for the prefix, which can be aggregated when computing the sequence score of the candidate sequence at the given time step, together with the score of the appended letter “a” and the sequence score of the preceding candidate sequence.

[0091] By way of another example, in some cases, when a certain candidate sequence shows unusual token combinations, such as, e.g., multiple time repetition of the same letter, etc., which does not exist in LM 1 or LM 2, it is possible that the LMs can provide penalty scores for such a sequence upon identification, e.g., in the form of a negative score.

[0092] There is now provided an example of possible implementation and modification to the beam search algorithm. For simplicity and exemplary purposes, consider two LMs having two lexicons, a general and a domain-specific for jargon terms, denoted VG, VJ, respectively. Denote the characters set by A of size K. To achieve identification of jargon terms, the character set is modified for the jargon lexicon by denoting the jargon character set as A', and identifying each £' G A' with £ G A in a one-to-one manner. Each character is further identified as f G A with an integer it G [K] such that it = it’ . Let 0 denote the empty sequence, and S = S(x) G02946369\37-01RLXK+1the output from the acoustic model (K characters and one blank symbol denoted -). S is arranged such that the i ith column corresponds to C G A for all it G [K], Furthermore, let P“, P+and Ptotdenote the blank, non-blank and total probabilities, with Ptot= P“ + P+. Denote ~y as the joint sequence (y, c), and let ° denote the concatenation operation. Let y-i denote the last character of the beam y. Finally, define three functions GetNextChars, ScoreBeam and GetBestBeams. GetNextCharsCy) returns a set of possible characters given ~y = (y, c). At each time t, it returns the characters corresponding to lexicon Ct provided that the current beam ends with a sub-word, otherwise it returns all possible characters. The function Score BeamCy, f, c) returns the probability of seeing (£, c) as an extension of the beam ~y. Using ScoreBeam, define Ptext(~y') = Score BeamCy , f, c) for ~y' = (y ° £ , c ° c). Finally, GelBeslBeamsCSM) returns the top M beams from B according to Ptot• ptext

[0093] Fig. 8 illustrates an exemplary algorithm describing the modification to the standard Connectionist Temporal Classification (CTC) beam search algorithm in accordance with certain embodiments of the presently disclosed subject matter. The proposed approach requires limited modifications of the original CTC beam search algorithm. Furthermore, since \GelNexlCharsCy)\ = K for each sub -word, one need not increase the number of beams, making the proposed approach scalable with the number of lexicons C.

[0094] The above Fig. 7 and Fig. 8 illustrate an efficient procedure for implementing the proposed text generation method based on beam search. The proposed approach provides a practical solution for handling domain-specific jargons in speech recognition in ASR applications that rely on the accurate transcription of specialized terminology. The proposed approach can also be applied to other NLP tasks, such as, e.g., machine translation, etc.

[0095] Fig. 9 illustrates an evaluation of the proposed method with respect to other methods of combining LMs in accordance with certain embodiments of the presently disclosed subject matter.

[0096] The different methods are evaluated on two setups: (i) incorporation of domain-specific jargon terms, and (ii) code-switching. In all experiments two02946369\37-01lexicons are used, a general and a domain-specific or secondary language model, denoted VG, VJ, respectively. Denote the probability density functions under the two LMs as PG and Pj. Continue with the above ASR example, a pre-trained acoustic model and two language models are employed. By way of example, in all experiments a pre-trained wav2vec 2.0 acoustic model is used through the Huggingface Transformers library and the Huggingface model hub.

[0097] For exemplary purposes, three datasets are used to evaluate the proposed approach: (i) Industrial English: this data consists of about 2.5 hours’ audio data divided into 267 audio files and corresponding transcriptions. Recording took place in an industrial facility with machinery background noise. The recordings contain Australian English utterances describing the conditions of the mechanical equipment on-site (e.g., jargon language), as well as discussions between different inspectors (e.g., general English); (ii) Industrial Thai: this data is similar in nature to the industrial English dataset. It consists of about 1 hour’s audio data divided into 90 audio files and corresponding transcriptions in the Thai language. In this data, it is common to find occasion code-switching to English. This dataset allows to evaluate the proposed approach in the context of code-switching. To that end, transliterations for all English terms are created; and (iii) Medical data including simulated patient physician medical interviews with a focus on respiratory cases. It consists of 272 audio files with corresponding transcriptions, and a total of about 55 hours’ data. The original recordings are segmented into shorter audio files of about 30 seconds each, along with the corresponding transcriptions. A domain-specific language model is constructed using approximately 1.5 hours of the segmented audio files, split into 0.5 hours for validation and 1 hour for testing.

[0098] The proposed method is compared with several methods for combining language models. The first one is linear interpolation, where the language models are combined using 7Pj + (1 - 7)PG for some G [0, 1], The second one is Log-linear interpolation, where the log probabilities are linearly interpolated: P'LP^ 'k, . The third method is Bin estimation method, which directly maps the word probability of the different LMs into a single probability value. This map is constructed by binning the LMs word probabilities space and calibrating the output probability. A limitation of the method is that it needs quite a large amount of data to estimate the output02946369\37-01probability correctly (estimated using histograms). The fourth method is using only general LM, and the fifth method is using only the domain-specific LM.

[0099] Evaluation metrics for all the methods include the test set average Character Error Rate (CER) and Word Error Rate (WER), in which lower scores indicate better performance.

[0100] With respect to the task of incorporating domain-specific LM into general LM, the industrial English and the medical dataset are used. A pre-trained XLSR- Wav2Vec 2.0 based model finetuned using the Common Voice dataset is employed. A 3-gram English LM trained using several public English datasets is used as the general LM. Furthermore, a domain-specific 3-gram LM is constructed using held-out data.

[0101] The evaluation results are presented in table 900. The proposed method achieves a significant reduction in the WER and CER compared to the other methods for combining language models as described above. Notably, significant error reduction is achieved for the industrial dataset which was recorded in a challenging acoustic environment.

[0102] With respect to the task of code switching, the Industrial TH dataset containing Thai sentences with occasional English words or terms is used. A pretrained Thai XLSR-Wav2Vec 2.0 based model, finetuned using the Thai Common Voice corpus, is employed. Two 3-gram LMs are trained: the first is trained with Thai text from a dedicated training set, while the second LM contains transliterations of English terms frequently used in the factory.

[0103] The evaluation results are presented in table 910. The proposed method achieves the best results with around 4.8% improvement in WER compared to the second best performing method. The results show the added value of using such a method to efficiently distinguish between different languages.

[0104] It is to be noted although certain embodiments of the presently disclosed subject matter are described in the context of ASR applications, this is for exemplary purposes only, and should not be regarded as limiting the present disclosure in any way. The proposed method is applicable to other language processing applications,02946369\37-01such as, e.g., generative pre-trained transformers (GPTs), etc., in addition to or in lieu of the ASR applications.

[0105] It is to be noted that examples illustrated in the present disclosure, such as, e.g., the input sequence, the beam search process, the scoring method in the beam search, the exemplary code for implementing beam search, the evaluation of the proposed method with respect to other method, etc., are illustrated for exemplary purposes, and should not be regarded as limiting the present disclosure in any way. Other appropriate examples / implementations can be used in addition to, or in lieu of the above.

[0106] Among advantages of certain embodiments of the presently disclosed subject matter as described herein is to provide a method of combining / integrating multiple LMs directed to different domains for the purpose of improved text generation, such as integrating a domain-specific LM(s) and a general-purpose LM. Specifically, it is proposed to allow prediction of a word by the most plausible LM only (i.e., each word is predicted based on a score provided by one source LM), instead of interpolating over multiple LMs and predicting a word based on an interpolated score, thus alleviating the over-smoothing effect. This allows to preserve domain-specific information while leveraging the general knowledge of the pre-trained general- purpose LM. Evaluation shows that the proposed method significantly reduces the domain-specific word error rate while preserving the performance in the general domain.

[0107] In addition, the proposed method has high interpretability / explanability in terms of the predicted text output with respect to the prediction process. The method can associate predicted words with their source lexicon / LM that predicts the word, e.g., by marking the words with visual indication assigned to the source LMs, such that it is easier for the user to understand which LM made the respective word prediction. The proposed method can be used to support multiple domains having specialized jargons.

[0108] It is to be understood that the present disclosure is not limited in its application to the details set forth in the description contained herein or illustrated in the drawings.02946369\37-01

[0109] It will also be understood that the system according to the present disclosure may be, at least partly, implemented on a suitably programmed computer. Likewise, the present disclosure contemplates a computer program being readable by a computer for executing the method of the present disclosure. The present disclosure further contemplates a non-transitory computer-readable memory tangibly embodying a program of instructions executable by the computer for executing the method of the present disclosure.

[0110] The present disclosure is capable of other embodiments and of being practiced and carried out in various ways. Hence, it is to be understood that the phraseology and terminology employed herein are for the purpose of description and should not be regarded as limiting. As such, those skilled in the art will appreciate that the conception upon which this disclosure is based may readily be utilized as a basis for designing other structures, methods, and systems for carrying out the several purposes of the presently disclosed subject matter.

[0111] Those skilled in the art will readily appreciate that various modifications and changes can be applied to the embodiments of the present disclosure as hereinbefore described without departing from its scope, defined in and by the appended claims.02946369\37-01

Claims

CLAIMS1. A computerized method for text generation, the method comprising: obtaining an input sequence representing probability distribution of possible tokens at different steps in a sequential order; and processing the input sequence in accordance with the sequential order using a plurality of language models (LMs) respectively trained for specific domains, so as to generate an output sequence representing a predicted text portion corresponding to the input sequence, wherein the output sequence comprises a sequence of words, each given word being predicted at least based on a word score provided by a source LM from the plurality of LMs and associated with a specific indication of the source LM, the source LM corresponding to a specific domain where the given word is probable to appear, and the output sequence has the highest sequence score computed based on the word score of each word in the output sequence.

2. The computerized method according to claim 1, wherein the input sequence is a score matrix comprising scores representing the probability distribution of possible tokens at different steps, and each given word is predicted based on one or more scores of one or more tokens constituting the given word from the score matrix and the word score.

3. The computerized method according to claim 1, wherein the sequential order is a time series, and the input sequence is a score matrix comprising scores representing the probability distribution of possible tokens at different time steps in the time series, the probability matrix being generated by an acoustic model from an input speech utterance spoken during the time series, and wherein the output sequence represents a predicted text transcription corresponding to the input speech utterance.

4. The computerized method according to claim 1, wherein the plurality of LMs comprises at least a first LM previously trained using general language corpus and a second LM previously trained using domain-specific language corpus, and wherein the sequence of words in the output sequence comprises one or more general words predicted by the first LM and associated with the specific indication thereof, and / or02946369\37-01one or more domain-specific words predicted by the second LM and associated with the specific indication thereof.

5. The computerized method according to claim 1, wherein the plurality of LMs comprises at least a first LM previously trained using a first language corpus and a second LM previously trained using a second language corpus, and wherein the sequence of words in the output sequence comprises one or more words from the first language predicted by the first LM and associated with the specific indication thereof, and one or more domain-specific words predicted by the second LM and / or associated with the specific indication thereof.

6. The computerized method according to claim 1, wherein the processing is performed step by step using a search algorithm in a search space, comprising: at a given step, deriving one or more candidate words to be included in one or more candidate sequences, each given candidate word predicted at least based on a word score by a source LM of a specific domain where the given candidate word is probable to appear, the word score causing a respective candidate sequence that includes the given candidate word to have relatively high sequence score to be selected at the given step, and associating each given candidate word with the specific indication of the source LM thereof; wherein upon completion of processing the input sequence, the output sequence is selected as a candidate sequence that has the highest sequence score among the one or more candidate sequences.

7. The computerized method according to claim 1, wherein the processing is performed step by step using beam search with a beam width n, and each LM of the plurality of LMs is assigned with a specific indication thereof, the possible tokens from the input sequence being respectively associated with the plurality of LMs and specific indications thereof, the processing comprising: at a given step in the input sequence, appending possible tokens of the given step of the input sequence respectively associated with the plurality of LMs to each 02946369\37-01given candidate sequence of n candidate sequences resulting from a preceding step, giving rise to possible candidate sequences for the given step; computing a sequence score for each possible candidate sequence by aggregating a score of an appended token, and a word score of a candidate word or sub-word formed by the appending, with the sequence score of the candidate sequence resulting from the preceding step, the word score provided by a source LM that the appended token is associated with; and selecting n possible candidate sequences with n highest sequence scores to be the n candidate sequences for the given step.

8. The computerized method according to claim 7, wherein in cases where an appended token at the given step represents a whitespace indicative of completion of a candidate word which has at least one preceding candidate word predicted by the same source LM in a possible candidate sequence, the word score of the candidate word provided by the source LM is based on the at least one preceding candidate word.

9. The computerized method according to claim 7, wherein in cases where the given step is within a word, the appending comprises appending possible tokens of the given step that a preceding token is associated with.

10. The computerized method according to claim 1, wherein the specific indication of the source LM is a specific visual representation to be associated with a word predicted by the source LM.

11. The computerized method according to claim 10, wherein the specific indication of the source LM is a specific color to be associated with a word predicted by the source LM, and each word in the sequence of words of the output sequence is respectively colored with a specific color of the source LM thereof.

12. The computerized method according to claim 1, further comprising filtering the output sequence by filtering out one or more words associated with a specific indication of a specific LM.02946369\37-0113. The computerized system according to claim 1, wherein the output sequence has a reduced word error rate with respect to an output sequence provided by interpolating over the plurality of LMs.

14. A computerized system of text generation, the system comprising a processing circuitry configured to: obtain an input sequence representing probability distribution of possible tokens at different steps in a sequential order; and process the input sequence in accordance with the sequential order using a plurality of language models (LMs) respectively trained for specific domains, so as to generate an output sequence representing a predicted text portion corresponding to the input sequence, wherein the output sequence comprises a sequence of words, each given word being predicted at least based on a word score provided by a source LM from the plurality of LMs and associated with a specific indication of the source LM, the source LM corresponding to a specific domain where the given word is probable to appear, and the output sequence has the highest sequence score computed based on the word score of each word in the output sequence.

15. The computerized system according to claim 14, wherein the input sequence is a score matrix comprising scores representing the probability distribution of possible tokens at different steps, and each given word is predicted based on one or more scores of one or more tokens constituting the given word from the score matrix and the word score.

16. The computerized system according to claim 14, wherein the sequential order is a time series, and the input sequence is a score matrix comprising scores representing the probability distribution of possible tokens at different time steps in the time series, the probability matrix being generated by an acoustic model from an input speech utterance spoken during the time series, and wherein the output sequence represents a predicted text transcription corresponding to the input speech utterance.

17. The computerized system according to claim 14, wherein the plurality of LMs comprises at least a first LM previously trained using general language corpus and a second LM previously trained using domain-specific language corpus, and wherein02946369\37-01the sequence of words in the output sequence comprises one or more general words predicted by the first LM and associated with the specific indication thereof, and / or one or more domain-specific words predicted by the second LM and associated with the specific indication thereof.

18. The computerized system according to claim 14, wherein the plurality of LMs comprises at least a first LM previously trained using a first language corpus and a second LM previously trained using a second language corpus, and wherein the sequence of words in the output sequence comprises one or more words from the first language predicted by the first LM and associated with the specific indication thereof, and / or one or more domain-specific words predicted by the second LM and associated with the specific indication thereof.

19. The computerized system according to claim 14, wherein the processing circuitry is configured to process the input sequence step by step using a search algorithm in a search space by: at a given step, deriving one or more candidate words to be included in one or more candidate sequences, each given candidate word predicted at least based on a word score by a source LM of a specific domain where the given candidate word is probable to appear, the word score causing a respective candidate sequence that includes the given candidate word to have a relatively high sequence score to be selected at the given step, and associating each given candidate word with the specific indication of the source LM thereof; wherein upon completion of processing the input sequence, the output sequence is selected as a candidate sequence that has the highest sequence score among the one or more candidate sequences.

20. The computerized system according to claim 14, wherein each LM of the plurality of LMs is assigned with a specific indication thereof, the possible tokens from the input sequence being respectively associated with the plurality of LMs and specific indications thereof, and the processing circuitry is configured to process the input sequence step by step using beam search with a beam width n by:02946369\37-01at a given step in the input sequence, appending possible tokens of the given step of the input sequence respectively associated with the plurality of LMs to each given candidate sequence of n candidate sequences resulting from a preceding step, giving rise to possible candidate sequences for the given step; computing a sequence score for each possible candidate sequence by aggregating a score of an appended token, and a word score of a candidate word or sub-word formed by the appending, with the sequence score of the candidate sequence resulting from the preceding step, the word score provided by a source LM that the appended token is associated with; and selecting n possible candidate sequences with n highest sequence scores to be the n candidate sequences for the given step.

21. The computerized system according to claim 20, wherein in cases where an appended token at the given step represents a whitespace indicative of completion of a candidate word which has at least one preceding candidate word predicted by the same source LM in a possible candidate sequence, the word score of the candidate word provided by the source LM is based on the at least one preceding candidate word.

22. The computerized system according to claim 20, wherein in cases where the given step is within a word, the appending comprises appending possible tokens of the given step that a preceding token is associated with.

23. The computerized system according to claim 14, wherein the specific indication of the source LM is a specific visual representation to be associated with a word predicted by the source LM.

24. The computerized system according to claim 23, wherein the specific indication of the source LM is a specific color to be associated with a word predicted by the source LM, and each word in the sequence of words of the output sequence is respectively colored with a specific color of the source LM thereof.

25. The computerized system according to claim 14, wherein the processing circuitry is further configured to filter the output sequence by filtering out one or more words associated with a specific indication of a specific LM.02946369\37-0126. The computerized system according to claim 14, wherein the output sequence has a reduced word error rate with respect to an output sequence provided by interpolating over the plurality of LMs.

27. A non-transitory computer readable storage medium tangibly embodying a program of instructions that, when executed by a computer, cause the computer to perform a method of text generation, the method comprising: obtaining an input sequence representing probability distribution of possible tokens at different steps in a sequential order; and processing the input sequence in accordance with the sequential order using a plurality of language models (LMs) respectively trained for specific domains, so as to generate an output sequence representing a predicted text portion corresponding to the input sequence, wherein the output sequence comprises a sequence of words, each given word being predicted at least based on a word score provided by a source LM from the plurality of LMs and associated with a specific indication of the source LM, the source LM corresponding to a specific domain where the given word is probable to appear, and the output sequence has the highest sequence score computed based on the word score of each word in the output sequence.02946369\37-01

Citation Information

Patent Citations

  • Speech recognition device and program thereof

    JP2013125144A

  • Clustering system, clustering method, clustering program and attribute estimation system using clustering system

    US7707028B2

  • Multi-domain machine translation model adaptation

    US9235567B2