Load a n-gram language model for mathematics in ARPA format which gets
    shipped with hwrt.

    Returns
    -------
    A NgramLanguageModel object

def load_model():
    """
    Load a n-gram language model for mathematics in ARPA format which gets
    shipped with hwrt.

    Returns
    -------
    A NgramLanguageModel object
    """
    logging.info("Load language model...")
    ngram_arpa_t = pkg_resources.resource_filename('hwrt',
                                                   'misc/ngram.arpa.tar.bz2')
    with tarfile.open(ngram_arpa_t, 'r:bz2') as tar:
        tarfolder = tempfile.mkdtemp()
        tar.extractall(path=tarfolder)
    ngram_arpa_f = os.path.join(tarfolder, 'ngram.arpa')
    with open(ngram_arpa_f) as f:
        content = f.read()
    ngram_model = NgramLanguageModel()
    ngram_model.load_from_arpa_str(content)
    return ngram_model