instance_text: Transform an instance back into text

instance_textR Documentation

Transform an instance back into text

Description

"Reads" a MALLET instance as a text string for quick inspection.

Usage

instance_text(instance, vocab = instances_vocabulary(instance), collapse = " ")

Arguments

instance

reference to an instance

vocab

character vector giving the vocabulary

collapse

passed on to paste

Details

In the case of DfR data, the resulting string will not have meaningful word order: not very informative except for spot-checks for garbage data, correct stop-wording, etc.

Repeated calls will be much faster if you retrieve the vocabulary separately and pass that in as vocab. An InstanceList guarantees that all Instances have the same vocabulary.

Value

A string "spelling out" the instance text


agoldst/dfrtopics documentation built on July 15, 2022, 4:13 p.m.