Package: kgrams 0.2.1

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.1.tar.gz
kgrams_0.2.1.zip(r-4.5)kgrams_0.2.1.zip(r-4.4)kgrams_0.2.1.zip(r-4.3)
kgrams_0.2.1.tgz(r-4.4-x86_64)kgrams_0.2.1.tgz(r-4.4-arm64)kgrams_0.2.1.tgz(r-4.3-x86_64)kgrams_0.2.1.tgz(r-4.3-arm64)
kgrams_0.2.1.tar.gz(r-4.5-noble)kgrams_0.2.1.tar.gz(r-4.4-noble)
kgrams_0.2.1.tgz(r-4.4-emscripten)kgrams_0.2.1.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

Pkgdown:https://vgherard.github.io

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

On CRAN:

language-modelsn-gramsnatural-language-processingcpp

5.14 score 7 stars 1 packages 13 scripts 638 downloads 21 exports 5 dependencies

Last updated 1 months agofrom:bf86cee71a (on v0.2.1). Checks:OK: 1 NOTE: 8. Indexed: yes.

TargetResultDate
Doc / VignettesOKDec 14 2024
R-4.5-win-x86_64NOTEDec 14 2024
R-4.5-linux-x86_64NOTEDec 14 2024
R-4.4-win-x86_64NOTEDec 14 2024
R-4.4-mac-x86_64NOTEDec 14 2024
R-4.4-mac-aarch64NOTEDec 14 2024
R-4.3-win-x86_64NOTEDec 14 2024
R-4.3-mac-x86_64NOTEDec 14 2024
R-4.3-mac-aarch64NOTEDec 14 2024

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

Dependencies:rbibutilsRcppRcppProgressRdpackrlang

Classical $k$-gram Language Models in R

Rendered fromkgrams.Rmdusingknitr::rmarkdownon Dec 14 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