compatible_instances: Generate a new InstanceList compatible with an old one

compatible_instancesR Documentation

Generate a new InstanceList compatible with an old one

Description

Given an InstanceList object and some new documents (in the same two-column data-frame format as that expected by make_instances), this yields a reference to a new InstanceList which is "compatible" with the old one. These new instances can be used, for example, with MALLET's topic-inferencing functionality.

Usage

compatible_instances(docs, instances)

Arguments

docs

data frame with id and text columns

instances

reference InstanceList object

Details

"Compatible" instances have the same vocabulary in the same order as the reference InstanceList. In particular, this means words not in the reference vocabulary must be dropped.

The new InstanceList object can be written to disk with write_instances.

Value

a reference to the new InstanceList object

See Also

infer_topics


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