| Kiwi | R Documentation |
Kiwi class is provide method for korean mophological analyze result.
print()print method for Kiwi objects
Kiwi$print(x, ...)
xself
...ignored
new()Create a kiwi instance.
Kiwi$new( num_workers = 0, model_size = "base", integrate_allomorph = TRUE, load_default_dict = TRUE )
num_workersint(optional): use multi-thread core number. default is 0 which means use all core.
model_sizechar(optional): kiwi model select. default is "base". "small", "large" is available.
integrate_allomorphbool(optional): default is TRUE.
load_default_dictbool(optional): use defualt dictionary. default is TRUE.
add_user_word()add user word with pos and score
Kiwi$add_user_word(word, tag, score, orig_word = "")
wordchar(required): target word to add.
tagTags(required): tag information about word.
scorenum(required): score information about word.
orig_wordchar(optional): origin word.
add_pre_analyzed_words()TODO
Kiwi$add_pre_analyzed_words(form, analyzed, score)
formchar(required): target word to add analyzed result.
analyzeddata.frame(required): analyzed result expected.
scorenum(required): score information about pre analyzed result.
add_rules()TODO
Kiwi$add_rules(tag, pattern, replacement, score)
tagTags(required): target tag to add rules.
patternchar(required): regular expression.
replacementchar(required): replace text.
scorenum(required): score information about rules.
load_user_dictionarys()add user dictionary using text file.
Kiwi$load_user_dictionarys(user_dict_path)
user_dict_pathchar(required): path of user dictionary file.
extract_words()Extract Noun word candidate from texts.
Kiwi$extract_words( input, min_cnt, max_word_len, min_score, pos_threshold, apply = FALSE )
inputchar(required): target text data
min_cntint(required): minimum count of word in text.
max_word_lenint(required): max word length.
min_scorenum(required): minimum score.
pos_thresholdnum(required): pos threashold.
applybool(optional): apply extracted word as user word dict.
analyze()Analyze text to token and tag results.
Kiwi$analyze(text, top_n = 3, match_option = Match$ALL, stopwords = FALSE)
textchar(required): target text.
top_nint(optional): number of result. Default is 3.
match_optionmatch_option Match: use Match. Default is Match$ALL
stopwordsstopwords option. Default is FALSE which is use nothing.
If TRUE, use embaded stopwords dictionany.
If char: path of dictionary txt file, use file.
If Stopwords class, use it.
If not valid value, work same as FALSE.
list of result.
tokenize()Analyze text to token and pos result just top 1.
Kiwi$tokenize( text, match_option = Match$ALL, stopwords = FALSE, form = "tibble" )
textchar(required): target text.
match_optionmatch_option Match: use Match. Default is Match$ALL
stopwordsstopwords option. Default is FALSE which is use nothing.
If TRUE, use embaded stopwords dictionany.
If char: path of dictionary txt file, use file.
If Stopwords class, use it.
If not valid value, work same as FALSE.
formchar(optional): return form. default is "tibble".
"list", "tidytext" is available.
split_into_sents()Some text may not split sentence by sentence. split_into_sents works split sentences to sentence by sentence.
Kiwi$split_into_sents(text, match_option = Match$ALL, return_tokens = FALSE)
textchar(required): target text.
match_optionmatch_option Match: use Match. Default is Match$ALL
return_tokensbool(optional): add tokenized resault.
get_tidytext_func()set function to tidytext unnest_tokens.
Kiwi$get_tidytext_func(match_option = Match$ALL, stopwords = FALSE)
match_optionmatch_option Match: use Match. Default is Match$ALL
stopwordsstopwords option. Default is TRUE which is
to use embaded stopwords dictionary.
If FALSE, use not embaded stopwords dictionary.
If char: path of dictionary txt file, use file.
If Stopwords class, use it.
If not valid value, work same as FALSE.
function
\dontrun{
kw <- Kiwi$new()
tidytoken <- kw$get_tidytext_func()
tidytoken("test")
}
clone()The objects of this class are cloneable with this method.
Kiwi$clone(deep = FALSE)
deepWhether to make a deep clone.
## Not run:
kw <- Kiwi$new()
kw$analyze("test")
kw$tokenize("test")
## End(Not run)
## ------------------------------------------------
## Method `Kiwi$get_tidytext_func`
## ------------------------------------------------
## Not run:
kw <- Kiwi$new()
tidytoken <- kw$get_tidytext_func()
tidytoken("test")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.