Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get_cbow_matrix

Get CBOW Matrix.


Description

Get matrix with moving windows. Negative integer values indicate absence of a token at the respective position.

Usage

get_cbow_matrix(corpus, p_attribute,
  registry = Sys.getenv("CORPUS_REGISTRY"), matrix, window)

Arguments

corpus

a CWB corpus

p_attribute

a positional attribute

registry

the registry directory

matrix

a matrix

window

window size

Examples

registry <- if (!check_pkg_registry_files()) use_tmp_registry() else get_pkg_registry()

m <- get_region_matrix(
  corpus = "REUTERS", s_attribute = "places",
  strucs = 0L:5L, registry = registry
  )
windowsize <- 3L
m2 <- get_cbow_matrix(
  corpus = "REUTERS", p_attribute = "word",
  registry = registry, matrix = m, window = windowsize
  )
colnames(m2) <- c(-windowsize:-1, "node", 1:windowsize)

RcppCWB

'Rcpp' Bindings for the 'Corpus Workbench' ('CWB')

v0.3.2
GPL-3
Authors
Andreas Blaette [aut, cre], Bernard Desgraupes [aut], Sylvain Loiseau [aut], Oliver Christ [ctb], Bruno Maximilian Schulze [ctb], Stefan Evert [ctb], Arne Fitschen [ctb], Jeroen Ooms [ctb], Marius Bertram [ctb]
Initial release
2021-02-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.