Language Model Action Set
Importing a Language Model with Mapping between Characters
This example is not available for the CAS programming language.
Importing a Language Model with Mapping between Characters
This example is not available for the Lua programming language.
Importing a Language Model with Mapping between Characters
This section contains Python code. For more information about coding in Python, see Getting Started with SAS Viya for Python and SAS Viya: System Programming Guide.
The following code shows how you can use the lmImport action to import an n-gram language model with mapping between characters:
labelMapTable = {"name": "labelmaptable_name"},
casOut = {"name": "language_model"},
)
You need to modify values for the table, labelMapTable, and casOut parameters to fit the model table, the table that shows the mapping between characters, and the output table, respectively, that you want to use.
The optional parameter labelMapTable is necessary if the characters that appear in the table you specify in the table parameter are different from the ones that you want. For example, if you have downloaded from an external source an n-gram language model that is in all lowercase and you want the contents to be stored as all uppercase, you could specify the table shown in Figure 9 in the labelMapTable parameter.
Figure 9: Sample of Label Mapping Table

The lmImport action assumes that the first column of the labelMapTable table specifies the characters you want to change and the second column specifies the corresponding characters that you want to change to.
Importing a Language Model with Mapping between Characters
This example is not available for the R programming language.