Views
No views yet
@article{nohejl_etal_2024_film,
title={Beyond {{Film Subtitles}}: {{Is YouTube}} the {{Best Approximation}} of {{Spoken Vocabulary}}?},
author={Nohejl, Adam and Hudi, Frederikus and Kardinata, Eunike Andriani and Ozaki, Shintaro and Riera Machin, Maria Angelica and Sun, Hongyu and Vasselli, Justin and Watanabe, Taro},
year={2024}, eprint={2410.03240}, archiveprefix={arXiv}, primaryclass={cs.CL},
url={https://arxiv.org/abs/2410.03240v1}, journal={ArXiv preprint}, volume={arXiv:2410.03240v1 [cs]}
}pip install huggingface_hub
pip install https://github.com/kpu/kenlm/archive/master.zipen) model in the following way:import kenlm
from huggingface_hub import hf_hub_download
model_file = hf_hub_download(repo_id='naist-nlp/tubelex-kenlm', filename='tubelex-en.arpa.xz')
# Loading the model requires KenLM to be compiled with LZMA support (`HAVE_XZLIB`).
# Otherwise you fill first need to decompress the model.
model = kenlm.Model(model_file)
text = ''a sequence of words' # pre-tokenized, lower-cased, without punctuation
model.perplexity(text)