Language Model Action Set

Training an n-Gram Language Model

This example is not available for the CAS programming language.

Training an n-Gram Language Model

This example is not available for the Lua programming language.

Training an n-Gram Language Model

Train an n-Gram Language Model

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 textToNgram action to train an n-gram language model:




         casOut = {"name": "train_table", "replace": True})

                     casInVarList = ["_textVar_"],
                     nGrams       = 3,
                     casOut       = {"name": "ngram_table"}))

                    casOut = {"name": "count_table"})

                        casOut     = {"name": "langmodel_table"})

    name    = "langmodel_table.sashdat",
    replace = True)

Training an n-Gram Language Model

This example is not available for the R programming language.

Last updated: November 04, 2020