Learn R Programming

phrasemachine (version 1.1.2)

POS_tag_documents: POS tag documents

Description

Annotates documents (provided as a character vector with one entry per document) with pars-of-speech (POS) tags using the openNLP POS tagger

Usage

POS_tag_documents(documents, memory = "-Xmx512M")

Arguments

documents
A vector of strings (one per document).
memory
The default amount of memory (512MB) assigned to the NLP package to POS tag documents is often not enough for large documents, which can lead to a "java.lang.OutOfMemoryError". The memory argument defaults to "-Xmx512M" (512MB) in this package, and can be increased if necessary to accommodate very large documents.

Value

A list object.

Examples

Run this code
## Not run: ------------------------------------
# # make sure quanteda is installed
# requireNamespace("quanteda", quietly = TRUE)
# # load some example data:
# documents <- quanteda::data_corpus_inaugural
# 
# # run tagger
# tagged_documents <- POS_tag_documents(documents)
## ---------------------------------------------

Run the code above in your browser using DataLab