Open topic with navigation

# Calculate Perplexity

Perplexity is a metric used in the language modeling. It indicates the average branching factor for a typical language.

To measure perplexity, you need:

- Sample text that closely resembles the speech transcripts that you intend to process with the language model, or the speech transcripts themselves
- The language model to measure

To measure perplexity of a language model

1. Normalize the sample text (see Run Text Normalization).

2. Send an `AddTask` action to HPE IDOL Speech Server, and set the following parameters:

   `Type` | The task name. Set to `LmPerplexity`.
   `Tlm` | The base language model to analyze.
   `Text` | The sample text file.
   `Out` | The log file to generate.

For example:

    http://localhost:13000/action=AddTask&Type=LmPerplexity&Text=C:\data\transcript.txt&Tlm=C:\LP\ENUK\ver-ENUK-5.0.tlm&Out=PerpScore.ctm

This action uses port `13000` to instruct HPE IDOL Speech Server, which is located on the local machine, to calculate the perplexity of the `ver-ENUK-5.0.tlm` language model using the `transcript.txt` sample text, and to write the results to the `PerpScore.ctm` file.

This action returns a token. You can use the token to:

- Check the task status. See Check the Status of a Task.
- Retrieve the results. See Find Recommended Language Resources to Use in a Task.

© 2015-2017 Hewlett Packard Enterprise Development LP | Send documentation feedback to HPE Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to AutonomyTPFeedback@hpe.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_HP_HTML5_bannerTitle.htm