get_idf: generate IDF dict

Description Usage Arguments Details Value See Also Examples

View source: R/gen_idf.R

Description

Generate IDF dict from a list of documents.

Usage

1
get_idf(x, stop_word = STOPPATH, path = NULL)

Arguments

x

a list of character

stop_word

stopword path

path

output path

Details

Input list contains multiple character vectors with words, and each vector represents a document.

Stop words will be removed from the result.

If path is not NULL, it will write the result to the path.

Value

a data.frame or a file

See Also

https://en.wikipedia.org/wiki/Tf-idf#Inverse_document_frequency_2

Examples

1
get_idf(list(c("abc","def"),c("abc"," ")))

Example output

Loading required package: jiebaRD
  name     count
1  def 0.6931472
2  abc 0.0000000

jiebaR documentation built on Dec. 16, 2019, 1:19 a.m.