System and method for code switching semantic parsing

By training the first language model to translate a single language utterance into a code-switching utterance and generating synthetic training data, the problem of difficulty in obtaining code-switching training data in the existing technology is solved, and efficient semantic parser training and performance improvement are achieved.

CN118749104APending Publication Date: 2024-10-08GOOGLE LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202280093261.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-03-10
Filing Date
2022-04-26
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

Existing semantic parsing datasets are mainly in a single language, and generating code-switching training data requires a large amount of human annotations, making it difficult to obtain a sufficient amount of training data, especially when uncommon languages ​​or their combinations are involved.

Method used

By training a first language model to parse and translate monolingual utterances into code-switched utterances, a relatively small initial training data set is utilized to generate a large amount of synthetic training data used to train a semantic parser to process code-switched input.

Benefits of technology

It achieves equivalent performance using a small amount of human annotated data, quickly and efficiently expands code switching training data, and optimizes the language model's ability to understand code switching utterances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118749104A_ABST
    Figure CN118749104A_ABST
Patent Text Reader

Abstract

Systems and methods for generating code switching semantic parsing training data and training a semantic parser. In some examples, the processing system (102) may be configured to use a trained first language model (308b) to translate a first single language text sequence and first parse data (302) into a second code-switched text sequence and associated second parse data (310), and generate a second training instance (314) based on the second code-switched text sequence and the second parse data. In some examples, the processing system (102) may be further configured to generate a training set (314) from two or more of the second training examples, and use the training set to train a semantic parser (316a) to semantic parse the code switching utterance.
Need to check novelty before this filing date? Find Prior Art

Description

CROSS-REFERENCE TO RELATED APPLICATIONS

[0001] This application claims priority to Indian Patent Application No. 202241013023 filed on March 10, 2022, which is hereby incorporated by reference in its entirety. Background Art

[0002] Code-switching occurs when a speaker or writer alternates between two or more languages ​​(or more than two dialects or other language variants) within a given utterance (e.g., a sentence fragment, a sentence, a conversation, etc.). Understanding how to correctly interpret and semantically parse such code-switching utterances is important for the continued development and improvement of speech-based and text-based language models (e.g., automated assistants, translation models). Unfortunately, most existing semantic parsing datasets are in a single language (e.g., English), and generating code-switching training data typically requires time-consuming and expensive human annotations from people who are proficient in multiple languages, or synthetic generation schemes that themselves require very large human-annotated training datasets (e.g., 100,000 examples, 200,000 examples, etc.) (in each constituent language, or in the code-switching variant of interest). Therefore, it may be difficult to obtain a sufficient amount of training data to train a language model to semantically parse a given type of code-switching input, especially when the code-switching involves languages ​​or combinations thereof that are not particularly common. Summary of the invention

[0003] The present technology relates to systems and methods for efficiently generating synthetic code switching semantic parsing training data and using such training data to train semantic parsers. In some aspects of the technology, a first language model can be trained to process a single language utterance using parsing data that associates one or more text spans with one or more identifiers (e.g., slots, intents, span IDs, etc.), and to translate the single language utterance into a code switching utterance (e.g., an utterance with words in both English and Spanish, both English and Hindi, etc.) using new parsing data that associates one or more text spans in the code switching utterance with those same identifiers. The first language model can be trained to perform this type of task in any suitable manner and using any suitable data. For example, in some aspects, the first language model may be trained using a relatively small seed set of supervised training data (e.g., 1 example, 5 examples, 10 examples, 100 examples, 500 examples, 1,000 examples, 2,000 examples, 3,000 examples, 5,000 examples, 10,000 examples, etc.), where each example has a parsed single language utterance and a parsed code-switch equivalent. Such supervised training data may be generated in any suitable manner, such as by having a human expert (e.g., someone familiar with how a given group of speakers tends to mix the languages ​​in question) translate the single language utterances into code-switch utterances, or by having a human expert perform quality control on synthetically generated training examples. The processing system may then be configured to use the trained first language model to generate new synthetic training examples from a much larger set of parsed single language utterances by translating each single language text sequence and its parsed data into a code-switch text sequence and associated parsed data. These synthetically generated code-switch text sequences and their associated parsing data can then be included in a training set and used to train a semantic parser (e.g., a semantic parser included in a second language model) so that the semantic parser can learn how to directly perform semantic parsing on code-switch utterances that are similar to those in the training set.

[0004] Thus, the present technology enables the use of a relatively small initial training data set to train a first language model, which can then leverage the knowledge accumulated by the first language model to generate large amounts of realistic and accurate synthetic training data. The synthetic training data can then be used to directly train additional language models to accurately understand and semantically parse code-switching utterances. For example, in some aspects, the present technology can be used to transform a seed set of 100 human-annotated training examples into a full set of 170,000 training examples, and a new language model trained with the full set can parse code-switching inputs 40% better than an equivalent language model trained on a seed set of 100 human-annotated training examples. Further, a language model trained on the full set can parse code-switching inputs just as well as an equivalent language model trained on a set of 2,000 human-annotated training examples, thereby allowing equivalent performance to be achieved using 20 times less human-annotated training data. Likewise, in some aspects, the present technique can be used to transform a seed set of 3,000 human-annotated training examples into a full set of 170,000 training examples, and a new language model trained with the full set can parse code-switching inputs 15% better than an equivalent language model trained on the seed set of 3,000 human-annotated training examples. In this way, the present technique allows human experts' knowledge of a given type of code-switching to be quickly and efficiently expanded to generate large amounts of specific training data that can be used to optimize a language model to understand utterances that employ that same type of code-switching.

[0005] In one aspect, the present disclosure describes a computer-implemented method, comprising: for each given first training example in a plurality of first training examples, wherein each first training example in the plurality of first training examples includes first parsed data and a first text sequence in a single language, and the first parsed data associates each of one or more identifiers with a text span of the first text sequence: using a trained first language model to translate the first text sequence of the given first training example into a second text sequence, the second text sequence being a code-switched text sequence in at least two languages; using the trained first language model to generate second parsed data, the second parsed data associating each given identifier in the one or more identifiers with a given text span of the second text sequence; and using one or more processors of a processing system, generating a second training example based on the second text sequence and the second parsed data. In some aspects, each of the one or more identifiers corresponds to a semantic tag identified by a first semantic parser in the first text sequence of the given first training example. In some aspects, generating a second training example based on the second text sequence and the second parsed data includes: using one or more processors, generating third parsed data based on the second parsed data; and using one or more processors, including the third parsed data in the second training example. In some aspects, each of the one or more identifiers corresponds to a semantic tag identified by the first semantic parser in a first text sequence given a first training example, and generating the third parsed data based on the second parsed data includes: replacing each given identifier in the second parsed data with a semantic tag corresponding to the given identifier. In some aspects, each of the one or more identifiers corresponds to a semantic tag identified by the first semantic parser in a first text sequence given a first training example, and generating the third parsed data based on the second parsed data includes: associating each given identifier in the second parsed data with a semantic tag corresponding to the given identifier. In some aspects, the first text sequence of the given first training example is in a first language, and the second text sequence is a code-switched text sequence in the first language and the second language. In some aspects, the method further includes: generating a training set from two or more of the generated second training examples.In some aspects, the method further includes, for each given first training example in the plurality of first training examples: determining, using one or more processors, a first number of text spans in a first text sequence of the given first training example that are associated with a first identifier in the one or more identifiers in the first parsed data; determining, using one or more processors, a second number of text spans in a second text sequence that are associated with a first identifier in the one or more identifiers in the second parsed data; and excluding, using one or more processors, the second training example from the training set based on a determination that the first number and the second number are not equal. In some aspects, the method further includes, for each given first training example in the plurality of first training examples: determining, using one or more processors, a first list of all identifiers included in the one or more identifiers in the first parsed data of the given first training example; determining, using one or more processors, a second list of all identifiers included in the one or more identifiers in the second parsed data; and excluding, using one or more processors, the second training example from the training set based on a determination that the first list and the second list are not identical. In some aspects, the determination that the first list and the second list are not identical is based on a determination that the second list includes an identifier that is not included in the first list. In some aspects, the method further includes: training, using one or more processors, a second semantic parser based on the training set. In some aspects, the second semantic parser is part of a second language model.

[0006] In another aspect, the present disclosure describes a computer program product comprising computer-readable instructions that, when executed by a computer, cause the computer to perform one or more of the above methods.

[0007] In another aspect, the present disclosure describes a processing system comprising: (1) a memory storing a trained first language model; and (2) one or more processors coupled to the processor and configured to: for each given first training example in a plurality of first training examples, wherein each first training example in the plurality of first training examples comprises first parsed data and a first text sequence in a single language, and the first parsed data associates each of one or more identifiers with a text span of the first text sequence: using the trained first language model to translate the first text sequence of the given first training example into a second text sequence, the second text sequence being a code-switched text sequence in at least two languages; using the trained first language model to generate second parsed data, the second parsed data associating each given one of the one or more identifiers with a given text span of the second text sequence; and generating a second training example based on the second text sequence and the second parsed data. In some aspects, each of the one or more identifiers corresponds to a semantic token identified by the first semantic parser in the first text sequence of the given first training example. In some aspects, one or more processors are configured to generate a second training example based on a second text sequence and second parsed data, including being configured to: generate third parsed data based on the second parsed data; and include the third parsed data in the second training example. In some aspects, each of the one or more identifiers corresponds to a semantic tag identified by the first semantic parser in a first text sequence of a given first training example, and the one or more processors are configured to generate the third parsed data based on the second parsed data, including being configured to: replace each given identifier in the second parsed data with a semantic tag corresponding to the given identifier. In some aspects, each of the one or more identifiers corresponds to a semantic tag identified by the first semantic parser in a first text sequence of a given first training example, and the one or more processors are configured to generate the third parsed data based on the second parsed data, including being configured to: associate each given identifier in the second parsed data with a semantic tag corresponding to the given identifier. In some aspects, one or more processors are configured to translate a first text sequence of a given first training example into a second text sequence, including being configured to: translate a first text sequence in a first language into a second text sequence, the second text sequence being a code-switched text sequence in the first language and the second language. In some aspects, the one or more processors are further configured to generate a training set from two or more of the generated second training examples.In some aspects, the one or more processors are further configured to, for each given first training example in a plurality of first training examples: determine a first number of text spans in a first text sequence of the given first training example that are associated with a first identifier in one or more identifiers in the first parsed data; determine a second number of text spans in a second text sequence that are associated with a first identifier in one or more identifiers in the second parsed data; and based on a determination that the first number and the second number are not equal, exclude the second training example from the training set. In some aspects, the one or more processors are further configured to, for each given first training example in a plurality of first training examples: determine a first list of all identifiers included in one or more identifiers in the first parsed data of the given first training example; determine a second list of all identifiers included in one or more identifiers in the second parsed data; and based on a determination that the first list and the second list are not identical, exclude the second training example from the training set. In some aspects, the one or more processors are configured to further be configured to exclude the second training example from the training set based on a determination that the first list and the second list are not identical, including being configured to exclude the second training example from the training set based on a determination that the second list includes an identifier not included in the first list. In some aspects, the one or more processors are configured to further be configured to: train a second semantic parser based on the training set. In some aspects, the memory further stores a second language model, and the second semantic parser is part of the second language model. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 is a functional diagram of an example system in accordance with aspects of the present disclosure.

[0009] Figure 2 is a functional diagram of an example system in accordance with aspects of the present disclosure.

[0010] Figure 3 is a flow chart illustrating generating a trained language model and using the trained language model to generate a code switch semantic parsing training dataset according to aspects of the present disclosure.

[0011] Figure 4 Exemplary methods for generating code switch semantic parsing training data according to aspects of the present disclosure are set forth.

[0012] Figure 5 Exemplary methods for generating code switch semantic parsing training data according to aspects of the present disclosure are set forth.

[0013] Figure 6 The present disclosure provides a method for Figure 4 or Figure 5The present invention provides an exemplary method for generating code switching semantic parsing training data to generate a training set and training a semantic parser based on the training set.

[0014] Figure 7 The present disclosure provides a method for Figure 4 or Figure 5 An exemplary method of generating code switching semantic parsing training data to generate a filtered training set and training a semantic parser based on the training set.

[0015] Figure 8 The present disclosure provides a method for Figure 4 or Figure 5 An exemplary method of generating code switching semantic parsing training data to generate a filtered training set and training a semantic parser based on the training set. DETAILED DESCRIPTION

[0016] The present technology will now be described with respect to the following exemplary systems and methods.Common reference numerals between the figures depicted and described below are intended to identify like features. Example System

[0017] Figure 1 A high-level system diagram 100 of an exemplary processing system 102 for performing the methods described herein is shown. The processing system 102 may include one or more processors 104 and a memory 106 storing instructions 108 and data 110. The instructions 108 and data 110 may include one or more language models (e.g., Figure 3-Figure 8 In addition, data 110 may store training examples to be used for training a language model. For example, data 110 may include: Figure 3-Figure 8 training examples of the first language model and / or the second semantic parser, one or more examples used as a seed set for training the first language model (e.g., Figure 4 multiple first training examples), and / or Figure 4-Figure 8 The data 110 may further include data generated by the language models during training, such as responses of these language models for each training example, loss values ​​generated based on those responses, and the like.

[0018] The processing system 102 may reside on a single computing device. For example, the processing system 102 may be a server, a personal computer, or a mobile device, and one or more language models (e.g., Figure 3-Figure 8The first language model and / or the second semantic parser) and associated data may therefore be local to the single computing device. Similarly, the processing system 102 may reside on a cloud computing system or other distributed system. In this case, one or more language models (e.g., Figure 3-Figure 8 The first language model and / or the second semantic parser) and associated data may be distributed across two or more different physical computing devices. For example, in some aspects of the technology, a processing system may include: a first computing device that stores a language model (e.g., Figure 3-Figure 8 Similarly, in some aspects of the technology, the processing system may include: a first computing device that stores a first language model (e.g., Figure 3-Figure 8 a first language model); a second computing device storing a second language model (e.g., Figure 5-Figure 8 A second semantic parser of the first language model); and a third computing device storing data for training the first language model and training examples generated by the first language model. Further, in some aspects of the technology, the processing system may include: a first computing device storing a first language model having m layers (e.g., Figure 3-Figure 8 a first language model of layers 1-n; a second computing device storing layers nm of the first language model; a third computing device storing a second language model having m layers (e.g., Figure 5-Figure 8 a fourth computing device storing layers nm of the second language model; a fifth computing device storing data for training the first language model; and a sixth computing device storing training examples generated by the first language model.

[0019] Further in this regard, Figure 2A high-level system diagram 200 is shown in which the exemplary processing system 102 just described is shown in communication with various websites and / or remote storage systems (including websites 210 and 218 and remote storage system 226) via one or more networks 208. In this example, websites 210 and 218 each include one or more servers 212a-212n and 220a-220n, respectively. Each of servers 212a-212n and 220a-220n can have one or more processors (e.g., 214 and 222) and associated memory (e.g., 216 and 224) that stores instructions and data (including the content of one or more web pages). Similarly, although not shown, remote storage system 226 can also include one or more processors and memory that stores instructions and data. In some aspects of the technology, processing system 102 can be configured to retrieve data from one or more of website 210, website 218, and / or remote storage system 226 for use in a language model (e.g., Figure 3-Figure 8 Pre-training or training of a first language model and / or a second language model).

[0020] The processing system described herein can be implemented on any type of computing device (such as any type of general-purpose computing device, server, or collection thereof), and can further include other components typically present in a general-purpose computing device or server. Likewise, the memory of such a processing system can be of any non-transitory type capable of storing information accessible by a processor of the processing system. For example, the memory can include non-transitory media such as hard drives, memory cards, optical disks, solid-state, tape storage, etc. A computing device suitable for the roles described herein can include different combinations of the foregoing, whereby different portions of instructions and data are stored on different types of media.

[0021] In all cases, the computing devices described herein may further include any other components commonly used in conjunction with computing devices (such as a user interface subsystem). The user interface subsystem may include one or more user inputs (e.g., a mouse, keyboard, touch screen, and / or microphone) and one or more electronic displays (e.g., a monitor with a screen or any other electrical device operable to display information). Output devices other than electronic displays (such as speakers, lights, and vibration, pulse, or tactile elements) may also be included in the computing devices described herein.

[0022] The one or more processors included in each computing device may be any conventional processor, such as a commercially available central processing unit ("CPU"), a graphics processing unit ("GPU"), a tensor processing unit ("TPU"), and the like. Alternatively, one or more processors may be dedicated devices, such as ASICs or other hardware-based processors. Each processor may have multiple cores capable of operating in parallel. The processor, memory, and other elements of a single computing device may be stored in a single physical housing, or may be distributed between two or more housings. Similarly, the memory of a computing device may include a hard drive or other storage medium located in a housing different from the housing of the processor (such as in an external database or networked storage device). Therefore, references to processors or computing devices will be understood to include a collection of processors or computing devices or memories that may or may not operate in parallel, as well as references to one or more servers of a load-balanced server farm or a cloud-based system.

[0023] The computing device described herein can store instructions (such as machine code) that can be directly executed by a processor or instructions (such as scripts) that are indirectly executed. The computing device can also store data, which can be retrieved, stored or modified by one or more processors according to the instructions. The instructions can be stored on a computing device readable medium as a computing device code. In this regard, the terms "instructions" and "programs" can be used interchangeably herein. Instructions can also be stored in an object code format to be directly processed by a processor, or stored in any other computing device language, which includes a collection of scripts or independent source code modules that are interpreted or compiled in advance on demand. For example, the programming language can be C#, C++, JAVA or another computer programming language. Similarly, any component of an instruction or program can be implemented with a computer scripting language (such as JavaScript, PHP, ASP or any other computer scripting language). In addition, any of these components can be implemented using a combination of a computer programming language and a computer scripting language. Example Method

[0024] Figure 3 is a flow chart 300 illustrating generating a trained language model and using the trained language model to generate a code switch semantic parsing training dataset according to aspects of the present disclosure.

[0025] Figure 3The exemplary process depicted in begins with a set 302 of first training examples, each of which includes a parsed single language utterance. The set of first training examples can be of any suitable size and can come from any suitable source. For example, the set of first training examples can include any suitable number of pre-parsed training examples (e.g., 10,000, 50,000, 100,000, 200,000, 1,000,000, etc.) from one or more publicly available datasets of parsed training examples (such as the TOPv2 dataset, the original TOP dataset, the ATIS dataset, or the SNIPS dataset). Similarly, the set of first training examples can include one or more datasets of originally unparsed utterances and / or single language utterances harvested from any other suitable unparsed source (such as a website, a log of user queries, etc.). In this case, the unparsed utterances can then be parsed by a first semantic parser (not shown) to generate the set 302 of first training examples. The first semantic parser can be any suitable heuristic or learning semantic parser, which can be part of a language model. For example, each of the unparsed utterances can be parsed by a separate language model having the same architecture and initial parameters as the first language model 308a described further below. Likewise, the first semantic parser can be stored on the same processing system (e.g., processing system 102) as the first language model 308a, or the first semantic parser can be part of a different processing system such that only its output is stored on the same processing system as the first language model 308a. Furthermore, in some aspects of the technology, the set 302 of first training examples can be derived from audio data including spoken utterances. For example, a speech-to-text model or utility can be used to convert the audio data of the spoken utterance into a text utterance, which can then be further parsed as just described.

[0026] The set 302 of first training examples may include any suitable type of parsed data. Thus, in some aspects of the technology, the parsed data included in a given first training example may simply associate one or more numeric, textual, or alphanumeric universal identifiers (e.g., ordinal span IDs) with one or more textual spans in a single language utterance of a given first training example. Likewise, in some aspects, the parsed data included in a given first training example may associate numeric, textual, or alphanumeric semantic identifiers with one or more textual spans in a single language utterance of a given first training example. For example, a semantic identifier may indicate whether a given textual span in a single language utterance of a given first training example is an intent (e.g., a request to set an alarm, check traffic, etc.) or a slot (e.g., information related to setting an alarm, such as a time, date, alarm tone; information related to checking traffic, such as a geographic area, destination, time, date, etc.). Further, in some aspects, where the parsed data in each first training example includes one or more semantic identifiers, those semantic identifiers may be converted to universal identifiers (e.g., ordinal span IDs) before generating an equivalent parsed code-switching utterance.

[0027] exist Figure 3In the example of , a first portion of a set 302 of first training examples is provided to one or more human annotators 304 to generate a training seed set 306. Any suitable number (e.g., 1, 5, 10, 100, 500, 1,000, 2,000, 3,000, 5,000, 10,000, etc.) or percentage of the set 302 of first training examples may be used to generate the training set 306. The human annotators 304 will be assigned the task of translating a single language utterance into an equivalent code-switching utterance. In some aspects of the technology, the single language utterance may be in a first language, and the code-switching utterance may be a mixture of the first language and one or more other languages. For example, the human annotators 304 may be assigned the task of translating a parsed sentence in English into a similar parsed sentence in: a mixture of Spanish and English; a mixture of Spanish, Portuguese, and English; or a mixture of Hindi and English. Likewise, in some aspects of the technology, a single language utterance may be in a first language, and the code-switching utterance may be a mixture of two or more other languages. For example, a human annotator 304 may be tasked with translating a parsed sentence in English into a similar parsed sentence in a mixture of Spanish and Portuguese. In addition, for each identified text span in the parsed data of the first training example, the human annotator 304 is also tasked with labeling the corresponding text span in the code-switching utterance using the same identifier. Further in this regard, in some aspects of the technology, the human annotator 304 may be tasked with initially converting the semantic identifiers in the parsed data of each first training example into a universal identifier (e.g., an ordinal span ID), so that the universal identifier can then be used when labeling each corresponding text span in the code-switching utterance. Each of the parsed single language utterances translated by the human annotator 304 will be paired with the corresponding code-switching utterance and parsed data created by the human annotator 304 to create training examples for the training seed set 306.

[0028] exist Figure 3In the example of , the training seed set 306 is then used to train a first language model 308a. The first language model 308a can be any suitable type of language model (e.g., mT5, T5, BERT, LaMDA, GPT-3, etc.) with any suitable architecture and number of parameters. In addition, the first language model 308a can be completely untrained, pre-trained with a general language modeling task (e.g., a masked modeling task, a next sentence prediction task, a sentence completion task, etc.), pre-trained in a translation task (e.g., translating between the language used in the single language utterances of the training seed set 306 and one or more of the languages ​​of the code switching utterances of the training seed set 306), and / or pre-trained using any other suitable type of pre-training task. For example, in some aspects of the technology, the first language model 308a can be a small mT5 multilingual text-to-text transformer with 300 million parameters pre-trained in multiple languages, or a large mT5 multilingual text-to-text transformer with 13 billion parameters pre-trained in multiple languages.

[0029] As a result of the training, the first language model 308a becomes a trained first language model 308b, which is configured to receive a parsed single language utterance and generate an equivalent parsed code switching utterance. Figure 3 As shown, the trained first language model 308b can then be used to process the second portion of the set 302 of first training examples to generate a set 310 of synthetically generated code switch utterances and parsed data. Here again, any suitable portion of the first training examples can be used to generate the set 310 of synthetically generated code switch utterances and parsed data. For example, in some aspects of the technology, the entire remaining portion of the set 302 of first training examples that was not used to generate the training seed set 306 can be used to generate the set 310 of synthetically generated code switch utterances and parsed data. Similarly, in some aspects of the technology, a predetermined number (e.g., 10,000, 50,000, 100,000, 200,000, 1,000,000, etc.) or a predetermined percentage of the remaining first training examples can be used to generate the set 310 of synthetically generated code switch utterances and parsed data.

[0030] As shown in the dashed box 312, the trained first language model 308b or the processing system (e.g., the processing system 102) can also optionally be configured to associate the labels included in the set 302 of the first training examples with the synthetically generated code switch utterances and parsed data 310. For example, as discussed above, in the case where the parsed data in each first training example includes semantic identifiers, the trained first language model 308b or the processing system can be configured to convert those semantic identifiers into universal identifiers (e.g., ordinal span IDs) before the trained first language model 308b generates the synthetically generated code switch utterances and parsed data 310. In this case, the trained first language model 308b can be configured to generate the set 310 of synthetically generated code switch utterances and parsed data, wherein the parsed data uses universal identifiers. Then, the trained first language model 308b or another component (e.g., layer, function, etc.) of the processing system can be configured to associate each universal identifier in the synthetically generated code switch utterances and parsed data 310 with its corresponding semantic identifier. In some aspects of the technology, each universal identifier in the synthetically generated code switch utterance and parsed data 310 can be replaced with its corresponding semantic identifier. Likewise, in some aspects of the technology, the synthetically generated code switch utterance and parsed data 310 can be enhanced with data identifying the semantic identifier corresponding to each universal identifier in the parsed data.

[0031] exist Figure 3In the example of , each of the synthetically generated code switching utterances and parsing data 310 (and any modifications thereto according to the optional processing of box 312) is collected to form a set 314 of second training examples. In some aspects of the technology, the set of second training examples may further include one or more of the human-generated code switching utterances and parsing data of the training seed set 306. The set 314 of second training examples can then be used to train a semantic parser 316a to generate a trained semantic parser 316b that is capable of directly parsing code switching utterances similar to those included in the set 314 of second training examples (e.g., using the same language as those code switching utterances). The semantic parser 316a can be part of a dedicated semantic parser or another language model, and can be the same semantic parser (as discussed above) or a separate semantic parser used to initially parse each first training example in the set 302 of first training examples. In some aspects of the technology, the semantic parser 316a can be included in a separate language model (not shown) having the same architecture and initial parameters as the first language model 308a described above. Likewise, in some aspects, the semantic parser 316a may be stored on the same processing system (e.g., processing system 102) as the first language model 308a, or on a different processing system. Where the semantic parser 316a is part of a language model, the language model may be of any suitable type, with any suitable architecture and number of parameters. Such a language model may be completely untrained, pre-trained with a general language modeling task (e.g., a masked modeling task, a next sentence prediction task, a sentence completion task, etc.), pre-trained in a translation task (e.g., translating between the language used in the single language discourse of the training seed set 306 and one or more languages ​​in the language of the code switching discourse of the training seed set 306), and / or pre-trained using any other suitable type of pre-training task. For example, in some aspects of the technology, the semantic parser 316a may be included in a small mT5 multilingual text-to-text transformer with 300 million parameters pre-trained in multiple languages, or in a large mT5 multilingual text-to-text transformer with 13 billion parameters pre-trained in multiple languages.

[0032] Figure 4 An exemplary method 400 for generating code switch semantic parsing training data according to aspects of the present disclosure is set forth.

[0033] In step 402, a processing system (e.g., processing system 102) selects a given first training example from a plurality of first training examples, wherein each first training example includes first parsed data and a first text sequence in a single language, and the first parsed data associates each of one or more identifiers with a text span of the first text sequence. As further described below, the processing system will then perform steps 404-408 for the given first training example. For purposes of illustrating the steps of method 400, assume that the given first training example includes a first text sequence "What's the traffic like on Long Island going to the Hamptons tonight?", and the first parsed data associates a numeric identifier with the spans "traffic," "Long Island," "the Hamptons," and "tonight," as follows: "What's the [traffic] 1 like on [Long Island] 2 going to [the Hamptons] 3 [tonight] 4 ”.

[0034] The plurality of first training examples may be of any suitable size and may include examples from any suitable source and generated in any suitable manner, including the examples described above with respect to Figure 3All the options described in the set 302 of the first training examples of the first training examples. Therefore, here again, the plurality of first training examples may include any suitable number of pre-parsed training examples (e.g., 10,000, 50,000, 100,000, 200,000, 1,000,000, etc.) from one or more publicly available datasets of parsed training examples (such as the TOPv2 dataset, the original TOP dataset, the ATIS dataset, or the SNIPS dataset). Similarly, the plurality of first training examples may include the first text sequence harvested from one or more datasets of unparsed utterances and / or from any other suitable unparsed source (such as a website, a log of user queries, etc.). In this case, the unparsed first text sequence may have been parsed by a first semantic parser (not shown) to generate the plurality of first training examples. In the case of adopting the first semantic parser, the first semantic parser may be any suitable heuristic or learning semantic parser, which may be part of a language model. For example, the plurality of first text sequences may be parsed by a separate language model having the same architecture and initial parameters as the trained first language model of steps 404 and 406. The first semantic parser can be stored on the same processing system as the trained first language model, or the first semantic parser can be part of a different processing system such that only its output is stored on the same processing system as the trained first language model. In addition, in some aspects of the technology, the plurality of first training examples can be derived from audio data comprising spoken utterances. For example, a speech-to-text model or utility can be used to convert the audio data of the spoken utterance into a text utterance, which can then be further parsed as just described.

[0035] The first parsed data included in the plurality of first training examples may be of any suitable type and use any suitable type of identifier. Thus, in some aspects of the technique, the first parsed data included in each given first training example may associate one or more numeric, textual, or alphanumeric universal identifiers (e.g., ordinal span IDs) with one or more text spans in a first text sequence of the given first training example, such as the exemplary first text sequence discussed above (“What's the traffic like on [Long Island] 1 going to [the Hamptons] 2 [tonight] 3?”). Likewise, in some aspects, the first parsed data may include one or more numeric, textual, or alphanumeric semantic identifiers, such as a semantic identifier indicating whether a given text span in a first text sequence of a given first training example is an intent (e.g., a request to set an alarm, check traffic, etc.) or a slot (e.g., information related to setting an alarm, such as a time, date, alarm tone; information related to checking traffic, such as a geographic area, destination, time, date, etc.). For example, a given first text sequence may have initially been parsed by a semantic parser as “What’s the [traffic]?”. check_traffic like on [Long Island] zone going to [the Hamptons] destination [tonight] date_time ”. Further, in some aspects, where the first parsed data in each first training example includes semantic identifiers, the processing system can be further configured to convert those semantic identifiers into universal identifiers (e.g., ordinal span IDs) before steps 404 and / or 406, so that based on the universal identifiers, the trained first language model can translate the first text sequence and / or generate second parsed data (as further discussed below). For example, where the first text sequence is initially parsed as “What's the [traffic]” as just discussed, check_traffic like on [Long Island] zone going to [the Hamptons] destination [tonight] date_time ”, the processing system can convert the semantic tags “check_traffic”, “zone”, “destination”, and “date_time” into a universal numeric identifier, as follows: “What’s the [traffic] 1 like on [LongIsland] 2 going to [the Hamptons] 3 [tonight] 4 ?”.

[0036] In step 404, the processing system uses the trained first language model to translate the first text sequence of a given first training example into a second text sequence, which is a code-switched text sequence in at least two languages. Thus, using the exemplary first text sequence "What's the traffic like on Long Island goingto the Hamptons tonight?", the processing system can translate it into a second text sequence "Aaj raat Hamptons jaate hue Long Island par traffic kaisa hoga" in a mixture of English and Hindi. Despite this exemplary illustration, the trained first language model can be configured to perform the translation of step 404 between any suitable language combination. Thus, the first text sequence can be in the first language, and the code-switched text sequence can be a mixture of the first language and one or more other languages. For example, the first text sequence can be in English, and the code-switched text sequence can be: a mixture of Spanish and English; a mixture of Spanish, Portuguese and English, etc. Similarly, in some aspects of the technology, the first text sequence can be in the first language, and the code-switched text sequence can be a mixture of two or more other languages. For example, the first text sequence may be in English, and the code-switch text sequence may be a mixture of Spanish and Portuguese.

[0037] Here again, the trained language model can be any suitable type of language model, with any suitable architecture and number of parameters, that has been trained to perform the processing described in steps 404 and 406. For example, in some aspects of the technology, the trained first language model can be a small mT5 multilingual text-to-text transformer with 300 million parameters pre-trained in multiple languages, or a large mT5 multilingual text-to-text transformer with 13 billion parameters pre-trained in multiple languages, which has been further trained to receive a parsed single language utterance and generate an equivalent parsed code switching utterance. In some aspects of the technology, the trained first language model can have been partially or fully trained using a seed set of human-annotated training examples, such as described above with respect to training using the training seed set 306. Figure 3As described in the first language model 308a of . Likewise, in some aspects, the trained first language model can have been partially or fully trained using a seed set of synthetically generated training examples, each of which has been checked and confirmed for accuracy by a human. Further, in some aspects, before being trained to generate code switching utterances, the trained first language model can have been pre-trained with a general language modeling task (e.g., a masked modeling task, a next sentence prediction task, a sentence completion task, etc.), a translation task (e.g., translating between a language used in a first text sequence and one or more of a second text sequence), and / or any other suitable type of pre-training task.

[0038] In step 406, the processing system uses the trained first language model to generate second parsed data that associates each given identifier of the one or more identifiers with a given text span of the second text sequence. Thus, using the exemplary first text sequence "What's the traffic like on Long Island goingto the Hamptons tonight?", the processing system can generate second parsed data that associates the numeric identifier of the first parsed data with the corresponding text span in the second text sequence, as follows: "[Aaj raat] 4 [Hamptons] 3 jaate hue [Long Island] 2 par [traffic] 1 kaisa hoga”.

[0039] In step 408, the processing system generates a second training example based on the second text sequence and the second parsed data. Thus, using the exemplary text sequence discussed in each of the previous steps, the processing system can generate a second training example: {[Aaj raat] 4 [Hamptons] 3 jaate hue [Long Island] 2 par [traffic] 1 kaisahoga.}. It will be appreciated that any other suitable formatting may be used to represent the second training example. For example, in some aspects of the technology, the words of the second text sequence may be tokenized, or the words may be broken into one or more word fragments and tokenized using word fragment tokenization. Likewise, the second parsed data may use any suitable manner of associating one or more identifiers with each corresponding text span.

[0040] Furthermore, in some aspects of the technology, the second training example may include information based on the second text sequence and / or the second parsed data, rather than an exact copy of the second text sequence and / or the second parsed data. Figure 5 As further discussed, after generating the second parsed data in step 406, the trained first language model or module of the processing system may also be optionally configured to generate third parsed data based on the second parsed data by replacing each of the identifiers of the second parsed data with a semantic tag or associating each of the identifiers of the second parsed data with a semantic tag. In this case, since the third parsed data is generated based on the second parsed data, the second training example may include the third parsed data to replace or supplement the second parsed data.

[0041] In step 410, the processing system determines whether there are any remaining first training examples in the plurality of first training examples. If so, as indicated by the "yes" arrow, the processing system will proceed to select the next "given first training example" from the plurality of first training examples in step 412. Then, for this newly selected "given first training example" and each of the following ones, steps 404-412 will be repeated until the processing system determines at step 410 that there are no remaining first training examples in the plurality of first training examples, and ends at step 414, as indicated by the "no" arrow.

[0042] Figure 5 An exemplary method 500 for generating code switch semantic parsing training data according to aspects of the present disclosure is set forth. As described above, method 500 sets forth an optional method that may be performed after generating its second parsing data in step 406 for each given first training example.

[0043] Thus, step 502 assumes that, for each given first training example in the plurality of first training examples, method 400 will be performed as described above, and for each given first training example, steps 504 and 506 will be performed as part of generating a second training example (step 408).

[0044] In step 504, the trained first language model or module of the processing system generates third parsed data based on the second parsed data. This can be done in any suitable manner. For example, the third parsed data can be generated by replacing each given identifier in the second parsed data with a semantic tag (e.g., a slot or an intent) corresponding to the given identifier. Similarly, the third parsed data can be generated by associating each given identifier in the second parsed data with a semantic tag (e.g., a slot or an intent) corresponding to the given identifier.

[0045] As discussed above, in some aspects of the technology, the first text sequence may be initially parsed using a first semantic parser to include semantic tags, e.g., tags identifying different types of slots and intents. In this case, the processing system may be configured to Figure 4 Before steps 404 and / or 406, those semantic tags are converted into universal identifiers (e.g., ordinal span IDs). For example, in the first text sequence, which is initially parsed as "What's the [traffic] check_traffic like on [Long Island] zone going to [the Hamptons] destination [tonight] date_time ”, the processing system can convert the semantic tags “check_traffic”, “zone”, “destination”, and “date_time” into a universal numeric identifier, as follows: “What’s the [traffic] 1 like on [LongIsland] 2 going to [the Hamptons] 3 [tonight] 4 The trained first language model can then translate the first text sequence in steps 404 and 406 based on the universal identifier and generate second parsed data (as discussed above) to obtain the parsed code switch utterance “[Aaj raat] 4 [Hamptons] 3 jaate hue [Long Island] 2 par [traffic] 1 In this case, step 504 may be performed to generate third parsed data based on the second data, such as by generating third parsed data that replaces the numerical identifier of the second parsed data with the corresponding semantic tag from the initial semantic parsing or associates the numerical identifier of the second parsed data with the corresponding semantic tag from the initial semantic parsing.

[0046] Thus, in some aspects of the technology, the third parsed data may be a copy of the second parsed data, wherein each given identifier is replaced with a corresponding semantic tag. For example, the third parsed data may be data that associates the following: span "Aaj raat" with slot "date_time", span "Hamptons" with slot "destination", span "Long Island" with slot "zone", and span "traffic" with intent "check_traffic".

[0047] Likewise, in some aspects of the technology, the third parsed data may be data that associates each given identifier with a semantic tag. For example, the third parsed data may associate the following: identifier "1" with the semantic tag "check_traffic", identifier "2" with the semantic tag "zone", identifier "3" with the semantic tag "destination", and identifier "4" with the semantic tag "date_time".

[0048] In step 506, the processing system includes the third parsed data in the second training example (generated in step 408 as described above). As discussed above, the processing system can include the third parsed data in the second training example in place of or in addition to the second parsed data. For example, using the exemplary second text sequence and the second and third parsed data discussed above, in the case of including both the second and third parsed data, the second training example may be: {[Aaj raat] 4 [Hamptons] 3 jaate hue [Long Island] 2 par [traffic] 1 kaisahoga; 1|check_traffic; 2|zone; 3|destination; 4|date_time}. Similarly, in the case of only including the third parsed data, the second training example can be: {[Aaj raat] date_time [Hamptons] destination jaatehue [Long Island] zone par [traffic] check_traffickaisa hoga}. Here again, any other suitable formatting may be used to represent the second text sequence and the second parsed data and / or the third parsed data. For example, in some aspects of the technology, the words of the second text sequence may be lemmatized, or the words may be broken down into one or more word fragments and lemmatized using word fragment lemmatization. Likewise, the second parsed data and / or the third parsed data may use any suitable manner of associating one or more identifiers with each corresponding text span or each corresponding semantic marker.

[0049] Figure 6 The present disclosure provides a method for Figure 4 or Figure 5 An exemplary method 600 of generating code switching semantic parsing training data to generate a training set and training a semantic parser based on the training set.

[0050] Thus, step 602 assumes that at least method 400 and optionally method 500 will have been performed to generate a plurality of second training examples. The processing system will then generate a training set from two or more of those generated second training examples.

[0051] In step 604, the processing system trains a second semantic parser based on the training set. In this way, the second semantic parser can become configured to directly parse code switching text sequences similar to those included in the second training examples (e.g., using the same language as those code switching text sequences). The processing system can use any suitable training parameters and loss functions to train the second semantic parser. Therefore, in some aspects of the technology, the processing system can divide the training set into two or more batches and perform a backpropagation step between each batch to modify one or more parameters of the second semantic parser.

[0052] Here again, the second semantic parser can be a dedicated semantic parser or part of a language model. Figure 4 and Figure 5In the case where the first semantic parser discussed above has been used to parse each first text sequence, the second semantic parser can be the parser identical to the first semantic parser, or the second semantic parser can be the semantic parser different from the first semantic parser. Similarly, when the second semantic parser is included in the language model, the language model can use any suitable architecture and parameter quantity. Therefore, in some aspects, the second semantic parser can be included in a separate language model, and the separate language model has the same architecture and initial parameters as the first language model trained. In addition, such a language model can be completely untrained, pre-trained with a general language modeling task (e.g., masked modeling task, next sentence prediction task, sentence completion task, etc.), pre-trained in a translation task, and / or pre-trained using any other suitable type of pre-training task. For example, in some aspects of the technology, the second semantic parser can be included in a small mT5 multilingual text to text converter with 300 million parameters pre-trained in multiple languages, or included in a large mT5 multilingual text to text converter with 13 billion parameters pre-trained in multiple languages.

[0053] Figure 7 The present disclosure provides a method for Figure 4 or Figure 5 The exemplary method 700 of using the code switching semantic parsing training data generated by the method to generate a filtered training set and training a semantic parser based on the training set. In addition, the method 700 can be used with Figure 8 The method 800 is performed in conjunction with the method 800 as discussed below.

[0054] Therefore, step 702 assumes that at least method 400 and optionally method 500 will have been performed to generate a plurality of second training examples. In addition, step 702 reflects that method 800 may also optionally have been used to filter those generated plurality of second training examples. The processing system then generates a training set from two or more of the resulting second training examples.

[0055] As shown in step 704, for each given first training example in the plurality of first training examples, the processing system will perform steps 706-710 as part of performing method 400. Therefore, for each given first training example in the plurality of first training examples, steps 706-710 will be performed at least once.

[0056] In step 706, the processing system determines a first number of text spans in a first text sequence given a first training example that are associated with a first identifier in the one or more identifiers in the first parsed data. To illustrate, assume that the first text sequence is "9 pm appointment for photos and remind me an hour before (9 pm appointment for photos and remind me an hour before)", and the first parsed data associates a numeric identifier with a text span as follows: "[9 pm] 1 [appointment for photos] 2 and remind [me] 3 [an hour before] 4 In this case, the processing system may select the numeric identifier "3" as the "first identifier" and therefore determine that there is one text span ("me") associated with the numeric identifier "3" in the first parsed data. To simplify the explanation, step 706 makes this determination only for a single identifier. However, in some aspects of the technology, step 706 may be repeated for each of the one or more identifiers to calculate how many text spans are associated with each of the one or more identifiers in the first parsed data.

[0057] In step 708, the processing system determines a second number of text spans in the second text sequence associated with a first identifier in the one or more identifiers in the second parsed data. Using the example from above, the parsed second text sequence may be the following code-switched text sequence in a mixture of English and Hindi: “[mujhe] 3 [9 pm] 1 ko [photos ke liye appointment] 2 hai aur [mujhe] 3 [ek ghanta pehle] 4 In this case, the processing system will determine that there are two text spans associated with the numeric identifier "3" in the second parsed data (two instances of "mujhe"). Here again, in some aspects of the technology, for each of the one or more identifiers, step 708 can be repeated to calculate how many text spans are associated with each of the one or more identifiers in the second parsed data.

[0058] In step 710, the processing system excludes the second training example from the training set based on a determination that the first number and the second number are not equal. Thus, although method 400 will cause the processing system to generate a second training example (e.g., “[mujhe] 3 [9 pm] 1 ko [photos ke liye appointment] 2 haiaur [mujhe] 3 [ek ghanta pehle] 4 yaad dilaayen"), but the processing system can exclude this particular second training example from the training set based on the fact that the number of text spans associated with the identifier "3" in the first parsed data is not equal to the number of text spans associated with the first identifier in the second parsed data. Here again, for each of the one or more identifiers, step 710 can be repeated so that if any of the identifiers in the first parsed data is associated with a different number of text spans than it is in the second parsed data, the given second training example is excluded. Filtering in this manner can help generate a training set that more accurately trains the second semantic parser.

[0059] In step 712, the processing system trains a second semantic parser based on the training set. Figure 6 The same manner as described in step 604 is performed. Likewise, any of the options described above with respect to step 604 may be used to configure the second semantic parser.

[0060] Figure 8 The present disclosure provides a method for Figure 4 or Figure 5 Another exemplary method 800 of using the code switching semantic parsing training data generated by the method to generate a filtered training set and training a semantic parser based on the training set. As described above, the method 800 can also be used with Figure 7 The method 700 is performed in combination.

[0061] Therefore, step 802 assumes that at least method 400 and optionally method 500 will have been performed to generate a plurality of second training examples. In addition, step 802 reflects that method 700 may also optionally have been used to filter those generated plurality of second training examples. The processing system then generates a training set from two or more of the resulting second training examples.

[0062] As shown in step 804, for each given first training example in the plurality of first training examples, the processing system will perform steps 806-810 as part of performing method 400. Therefore, for each given first training example in the plurality of first training examples, steps 806-810 will be performed at least once.

[0063] In step 806, the processing system determines a first list of all identifiers included in the one or more identifiers in the first parsed data for a given first training example. For example, as a first illustration, the first text sequence may be "play [song] 1 [Heart is on fire] 2 on [spotify] 3 In this case, the processing system will determine a first list with identifiers "1", "2", and "3". As a second illustration, the first text sequence may be "Remind [me] 1 to [email] 2 [Michelle] 3 [on Tuesday] 4 [about] 5 [the recital] 6 In this case, the processing system will determine a first list having identifiers "1", "2", "3", "4", "5", and "6".

[0064] In step 808, the processing system determines a second list of all identifiers included in the one or more identifiers in the second parsed data. Using the first example from step 806, the parsed second text sequence may be the following code-switched text sequence in a mixture of English and Hindi: “[spotify] 3 par [song] 1 [Heart is onfire] two ko bajao". In this case, the processing system will determine a second list with identifiers "1", "two", and "3". Similarly, using the second example from step 806, the parsed second text sequence may be the following code-switched text sequence in a mixture of English and Hindi: "[Mujhe] 1 [Tuesday ko] 7 [Michelle] 3 ko[email] 2In this case, the processing system will determine a second list with identifiers "1", "2", "3", and "7".

[0065] In step 810, the processing system excludes the second training example from the training set based on a determination that the first list and the second list are not identical. Thus, using the first example, although method 400 will cause the processing system to generate a second training example based on the second text sequence and the second parsed data (e.g., “[spotify] 3 par [song] 1 [Heart is onfire] two ko bajao”), the processing system may exclude this particular second training example from the training set based on the fact that the first list includes “2” which is not in the second list, and the second list includes “two” which is not in the first list. Again, using this example, although method 400 will cause the processing system to generate a second training example (e.g., “[Mujhe] 1 [Tuesday ko] 7 [Michelle] 3 ko [email] 2 karneke liye yaad dilaayen"), but the processing system can exclude this particular second training example from the training set based on the fact that the first list includes "4", "5", and "6" that are not in the second list, and the second list includes "7" that is not in the first list. Here again, filtering in this manner can help generate a training set that more accurately trains the second semantic parser.

[0066] In step 812, the processing system trains a second semantic parser based on the training set. Figure 6 The same manner as described in step 604 is performed. Likewise, any of the options described above with respect to step 604 may be used to configure the second semantic parser.

[0067] Although methods 700 and 800 describe two exemplary types of filtering, any other suitable type of filtering may be employed, either alone or in combination with the filtering described in method 700 and / or method 800. For example, in some aspects of the technology, the processing system may filter out second training examples having formatting irregularities (e.g., unequal numbers of opening and closing brackets around the identified text span, unusual characters, etc.) that may cause the second semantic parser to incorrectly parse and / or misinterpret the second text sequence or its second parsed data.

[0068] Unless otherwise stated, the foregoing alternative examples are not mutually exclusive, but may be implemented in various combinations to achieve unique advantages. Since these and other variations and combinations of the features discussed above can be utilized without departing from the subject matter defined by the claims, the foregoing description of the exemplary systems and methods should be made by way of illustration rather than by way of limitation of the subject matter defined by the claims. In addition, the examples described herein and the provision of clauses expressed as "such as," "including," "comprising," etc. should not be interpreted as limiting the subject matter of the claims to specific examples; rather, these examples are intended to illustrate only some of the many possible embodiments. Further, the same reference numerals in different figures may identify the same or similar elements.

Claims

1. A computer-implemented method comprising: For each given first training example in a plurality of first training examples, wherein each first training example in the plurality of first training examples comprises first parsed data and a first text sequence in a single language, and the first parsed data associates each of one or more identifiers with a text span of the first text sequence: Using the trained first language model to translate the first text sequence of the given first training example into a second text sequence, the second text sequence being a code-switched text sequence in at least two languages; generating second parsed data using the trained first language model, the second parsed data associating each given identifier of the one or more identifiers with a given text span of the second text sequence; as well as Using one or more processors of the processing system, second training examples are generated based on the second text sequence and the second parsed data.

2. The method of claim 1, wherein each of the one or more identifiers corresponds to a semantic token identified by a first semantic parser in the first text sequence of the given first training example.

3. The method of claim 1 , wherein generating the second training example based on the second text sequence and the second parsed data comprises: generating, using the one or more processors, third parsed data based on the second parsed data; as well as Using the one or more processors, the third parsed data is included in the second training examples.

4. The method of claim 3, wherein each of the one or more identifiers corresponds to a semantic token identified by a first semantic parser in the first text sequence of the given first training example, and Generating the third parsed data based on the second parsed data includes: Each given identifier in the second parsed data is replaced with the semantic tag corresponding to the given identifier.

5. The method of claim 3, wherein each of the one or more identifiers corresponds to a semantic token identified by a first semantic parser in the first text sequence of the given first training example, and Generating the third parsed data based on the second parsed data includes: Each given identifier in the second parsed data is associated with the semantic tag corresponding to the given identifier.

6. The method according to any one of claims 1 to 5, wherein the first text sequence of the given first training example is in a first language, and the second text sequence is a code-switched text sequence in the first language and a second language.

7. The method according to any one of claims 1 to 6, further comprising: A training set is generated from two or more of the generated second training examples.

8. The method according to claim 7, further comprising, for each given first training example in the plurality of first training examples: determining, using the one or more processors, a first number of text spans in the first text sequence of the given first training example that are associated with a first identifier of the one or more identifiers in the first parsed data; determining, using the one or more processors, a second number of text spans in the second text sequence associated with the first identifier of the one or more identifiers in the second parsed data; as well as Using the one or more processors, based on a determination that the first number and the second number are not equal, excluding the second training example from the training set.

9. The method according to claim 7 or 8, further comprising, for each given first training example in the plurality of first training examples: determining, using the one or more processors, a first list of all identifiers included in the one or more identifiers in the first parsed data for the given first training example; determining, using the one or more processors, a second list of all identifiers included in the one or more identifiers in the second parsed data; as well as Using the one or more processors, based on a determination that the first list and the second list are not identical, excluding the second training examples from the training set.

10. The method of claim 9, wherein the determination that the first list and the second list are not the same is based on a determination that the second list includes identifiers that are not included in the first list.

11. The method according to any one of claims 7 to 10, further comprising: Using the one or more processors, a second semantic parser is trained based on the training set.

12. The method of claim 11, wherein the second semantic parser is part of a second language model.

13. A processing system comprising: A memory storing a trained first language model; as well as one or more processors coupled to the memory and configured to: For each given first training example in a plurality of first training examples, wherein each first training example in the plurality of first training examples comprises first parsed data and a first text sequence in a single language, and the first parsed data associates each of one or more identifiers with a text span of the first text sequence: Using the trained first language model to translate the first text sequence of the given first training example into a second text sequence, the second text sequence being a code-switched text sequence in at least two languages; generating second parsed data using the trained first language model, the second parsed data associating each given identifier of the one or more identifiers with a given text span of the second text sequence; as well as Second training examples are generated based on the second text sequence and the second parsed data.

14. The processing system of claim 13, wherein each of the one or more identifiers corresponds to a semantic token identified by a first semantic parser in the first text sequence of the given first training example.

15. The processing system of claim 13, wherein the one or more processors configured to generate the second training examples based on the second text sequence and the second parsed data comprises being configured to: generating third parsed data based on the second parsed data; and The third parsed data is included in the second training examples.

16. The processing system of claim 15, wherein each of the one or more identifiers corresponds to a semantic token identified by a first semantic parser in the first text sequence of the given first training example, and The one or more processors configured to generate the third parsed data based on the second parsed data include being configured to: replace each given identifier in the second parsed data with the semantic tag corresponding to the given identifier.

17. The processing system of claim 15, wherein each of the one or more identifiers corresponds to a semantic token identified by a first semantic parser in the first text sequence of the given first training example, and The one or more processors configured to generate the third parsed data based on the second parsed data include being configured to: associate each given identifier in the second parsed data with the semantic tag corresponding to the given identifier.

18. A processing system according to any one of claims 13 to 17, wherein the one or more processors are configured to translate the first text sequence of the given first training example into the second text sequence, including being configured to: translate the first text sequence in a first language into the second text sequence, the second text sequence being a code-switched text sequence in the first language and the second language.

19. The processing system of any one of claims 13 to 18, wherein the one or more processors are further configured to generate a training set from two or more of the generated second training examples.

20. The processing system of claim 19, wherein the one or more processors are further configured to, for each given first training example in a plurality of first training examples: determining a first number of text spans in the first text sequence of the given first training example that are associated with a first identifier of the one or more identifiers in the first parsed data; determining a second number of text spans in the second text sequence associated with the first identifier of the one or more identifiers in the second parsed data; as well as Based on a determination that the first number and the second number are not equal, the second training examples are excluded from the training set.

21. The processing system of claim 19 or 20, wherein the one or more processors are further configured to, for each given first training example in a plurality of first training examples: determining a first list of all identifiers included in the one or more identifiers in the first parsed data for the given first training example; determining a second list of all identifiers of the one or more identifiers included in the second parsed data; as well as Based on a determination that the first list and the second list are not identical, the second training examples are excluded from the training set.

22. A processing system according to claim 21, wherein the one or more processors are configured to further be configured to exclude the second training example from the training set based on a determination that the first list and the second list are not the same, including being configured to: exclude the second training example from the training set based on a determination that the second list includes an identifier that is not included in the first list.

23. The processing system of any one of claims 19 to 22, wherein the one or more processors are configured to further be configured to: train a second semantic parser based on the training set.

24. The processing system of claim 23, wherein the memory further stores a second language model, and the second semantic parser is part of the second language model.

25. A computer program product comprising computer readable instructions which, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 12.