NLoN: NLoN: Natural Language or Not

NLoNR Documentation

NLoN: Natural Language or Not

Description

NLoN identifies whether text lines are natural language or not using a glmnet model with simple text features and character 3-grams.

Examples


## Training data provided in the package for software engineering domain
nlon.data

## Build a model with glmnet
model <- with(head(nlon.data, 100), NLoNModel(text, rater2))
## Not run: model <- nlon.data[source == "mozilla", NLoNModel(text, rater2)]

## Use the model to predict new data.
topredict <- c("This is natural language.", "not(natural, language);")
NLoNPredict(model, topredict)

## Not run: NLoNPredict(model, nlon.data[source != "mozilla", text])


M3SOulu/NLoN documentation built on June 20, 2022, 6 p.m.