nglm: N-gram language model

Description Usage Examples

View source: R/NGramLanguageModel.R

Description

N-gram language model

Usage

1
nglm(model, output = NULL)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
# get working directory
# need to pass full path
wd <- getwd()

# Training to find "WEF"
data <- paste("This organisation is called the <START:wef> World Economic Forum <END>",
  "It is often referred to as <START:wef> Davos <END> or the <START:wef> WEF <END> .")

# train the model
model <- tnf_train(model = paste0(wd, "/wef.bin"), lang = "en",
  data = data, type = "wef")

ngram <- nglm(model)

## End(Not run)

news-r/decipher documentation built on July 19, 2019, 5:58 p.m.