Description Usage Arguments Value Examples
Get Tidy Token Names
1 2 3 | get_names_(file)
get_names(tag)
|
file |
File containing tagged names. |
tag |
Character vector containing tagged names. |
data.frame
of of 3 columns:
string - string identified
type - type of name
name - extracted name
a tibble
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## 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")
# Create sentences to test our model
sentences <- paste("This sentence mentions the World Economic Forum the annual meeting",
"of which takes place in Davos. Note that the forum is often called the WEF.")
# run model on sentences
results <- tnf(model = model, sentences = sentences)
# extract strings
(ext <- get_names(results))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.