Package: kgrams 0.2.0

kgrams: Classical k-gram Language Models

Training and evaluating k-gram language models in R, supporting several probability smoothing techniques, perplexity computations, random text generation and more.

Authors:Valerio Gherardi [aut, cre]

kgrams_0.2.0.tar.gz
kgrams_0.2.0.zip(r-4.5)kgrams_0.2.0.zip(r-4.4)kgrams_0.2.0.zip(r-4.3)
kgrams_0.2.0.tgz(r-4.4-arm64)kgrams_0.2.0.tgz(r-4.4-x86_64)kgrams_0.2.0.tgz(r-4.3-arm64)kgrams_0.2.0.tgz(r-4.3-x86_64)
kgrams_0.2.0.tar.gz(r-4.5-noble)kgrams_0.2.0.tar.gz(r-4.4-noble)
kgrams_0.2.0.tgz(r-4.4-emscripten)kgrams_0.2.0.tgz(r-4.3-emscripten)
kgrams.pdf |kgrams.html
kgrams/json (API)
NEWS

# Install kgrams in R:
install.packages('kgrams', repos = c('https://vgherard.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/vgherard/kgrams/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:

On CRAN:

language-modelsn-gramsnatural-language-processing

21 exports 7 stars 1.33 score 5 dependencies 258 downloads

Last updated 9 months agofrom:7d7e59dc6005bf01400349952d39e1d12de95158 (via v0.2.0)

Exports:%+%%|%as_dictionaryBOSdictionaryEOSinfokgram_freqslanguage_modelparamparam<-parametersperplexitypreprocessprobabilityprocess_sentencesquerysample_sentencessmootherstknz_sentUNK

Dependencies:rbibutilsRcppRcppProgressRdpackrlang

Classical $k$-gram Language Models in R

Rendered fromkgrams.Rmdusingknitr::rmarkdownon Jun 10 2024.

Last update: 2023-10-06
Started: 2021-02-06

Readme and manuals

Help Manual

Help pageTopics
String concatenation%+%
Word dictionariesas.character.kgrams_dictionary as_dictionary as_dictionary.character as_dictionary.kgrams_dictionary dictionary dictionary.character dictionary.connection dictionary.kgram_freqs
Special TokensBOS EOS special_tokens UNK
k-gram Frequency Tableskgram_freqs kgram_freqs.character kgram_freqs.connection kgram_freqs.kgram_freqs kgram_freqs.numeric process_sentences process_sentences.character process_sentences.connection
k-gram Language Modelslanguage_model language_model.kgram_freqs language_model.language_model
A Midsummer Night's Dreammidsummer
Much Ado About Nothingmuch_ado
Language Model Parametersparam param.kgram_freqs param<- parameters
Language Model Perplexitiesperplexity perplexity.character perplexity.connection
Text preprocessingpreprocess
Language Model Probabilitiesprobability probability.character probability.kgrams_word_context
Query k-gram frequency tables or dictionariesquery query.kgrams_dictionary query.kgram_freqs
Random Text Generationsample_sentences
k-gram Probability Smoothersinfo smoothers
Sentence tokenizertknz_sent
Word-context conditional expression%|% word_context