Last chance! 50% off unlimited learning
Sale ends in
pos
- Apply part of speech tagger to transcript(s).
pos_by
- Apply part of speech tagger to
transcript(s) by zero or more grouping variable(s).
pos_tags
- Useful for interpreting the parts of
speech tags created by pos and pos_by.pos(text.var, parallel = FALSE, cores = detectCores()/2,
progress.bar = TRUE, na.omit = FALSE, digits = 1, percent = TRUE,
zero.replace = 0, gc.rate = 10)
pos_by(text.var, grouping.var = NULL, digits = 1, percent = TRUE,
zero.replace = 0, ...)
pos_tags(type = "pretty")
TRUE
attempts to run
the function on multiple cores. Note that this may not
mean a speed boost if you have one core or if the data
set is smaller as the cluster takes time to create.parallel
= TRUE
. Default is half the number of available cores.TRUE
missing values
(NA
) will be omitted.TRUE
attempts to
provide a OS appropriate progress bar. If parallel is
TRUE
this argument is ignored. Note that setting
this argument to TRUE
may slow down the function.TRUE
output given as
percent. If FALSE
the output is proportion.pos
wraps. Consider adjusting this argument upward if the
error NULL
generates one word list for all text. Also
takes a single grouping variable or a list of 1 or more
grouping variables.pos
."pretty"
(a left justified version of the output
optimized for viewing but not good for export),
"matrix"
(a matrix versipos
- returns a list of 4:pos_by
- returns a list of 6:Maxent_POS_Tag_Annotator
,
colcomb2class
posdat <- pos(DATA$state)
ltruncdf(posdat, 7, 4)
## str(posdat)
names(posdat)
posdat$text #original text
## Methods
preprocessed(posdat) #words replaced with parts of speech
counts(posdat) #frequency of parts of speech by row
proportions(posdat) #proportion of parts of speech by row
## Methods Plotting
plot(preprocessed(posdat))
plot(counts(posdat))
plot(proportions(posdat))
plot(posdat)
out1 <- pos(DATA$state, parallel = TRUE) # not always useful
ltruncdf(out1, 7, 4)
#use pos_tags to interpret part of speech tags used by pos & pos_by
pos_tags()[1:10, ]
pos_tags("matrix")[1:10, ]
pos_tags("dataframe")[1:10, ]
pos_tags("df")[1:10, ]
ltruncdf(pos_tags("all"), 3)
posbydat <- with(DATA, pos_by(state, sex))
names(posbydat)
## Methods
scores(posbydat)
preprocessed(posbydat)
counts(posbydat)
proportions(posbydat)
## Methods Plotting
plot(preprocessed(posbydat))
plot(counts(posbydat))
plot(proportions(posbydat))
plot(posbydat)
ltruncdf(posbydat, 7, 4)
truncdf(posbydat$pos.by.prop, 4)
POSby <- with(DATA, pos_by(state, list(adult, sex)))
plot(POSby, values = TRUE, digits = 2)
#or more quickly - reuse the output from before
out2 <- with(DATA, pos_by(posbydat, list(adult, sex)))
Run the code above in your browser using DataLab