Language Model Action Set

Decoding RNN scores

This example is not available for the CAS programming language.

Decoding RNN scores

This example is not available for the Lua programming language.

Decoding RNN scores

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 lmDecode action to decode recurrent neural network (RNN) scores:

                  langModelTable = {"name": "language_model"},
                  blankLabel     = " ",
                  spaceLabel     = "&",
                  casOut         = {"name": "results"},
                 )

You need to modify values for the table, langModelTable, and casOut parameters to fit the in-memory table of RNN scores, the language model table, and the output table, respectively, that you want to use.

The lmDecode action assumes that the in-memory table comes from the dlScore action. This means that the RNN score columns in this table are assumed to be consecutive columns that follow the output table format of the dlScore action. The contents of the header line must be exactly the same. An example of this table, which has only two time frames and two labels to predict, is illustrated in Figure 4.

Figure 4: Sample Table

Sample Table


The lmDecode action assumes that the input table that is specified in the langModelTable parameter comes from the lmImport action. It is a single-cell CAS table of binary data.

An example of the output is shown in Figure 5, and Figure 6 shows the summary information.

Figure 5: Sample Output Table

Sample Output Table


Figure 6: Sample of Summary Information

Sample of Summary Information


Decoding RNN scores

This example is not available for the R programming language.

Last updated: November 04, 2020