tCorpus-cash-feature_stats: Feature statistics

Description Arguments Examples

Description

Compute a number of useful statistics for features: term frequency, idf, etc.

Usage:

## R6 method for class tCorpus. Use as tc$method (where tc is a tCorpus object).

1
feature_stats(feature, sent_freq=F)

Arguments

feature

The name of the feature column

sent_freq

If True, include sentence frequency (only if sentence information is available).

Examples

1
2
3
4
5
6
7
8
tc = create_tcorpus(c('Text one first sentence. Text one second sentence', 'Text two'),
                    split_sentences = TRUE)

fs = tc$feature_stats('token')
head(fs)

fs = tc$feature_stats('token', context_level = 'sentence')
head(fs)

kasperwelbers/corpustools documentation built on Sept. 1, 2018, 1:03 p.m.