Learn R Programming

quanteda.textmodels

About

An R package adding text scaling models and classifiers for quanteda. Prior to quanteda v2, many of these were part of that package. Early development was supported by the European Research Council grant ERC-2011-StG 283794-QUANTESS.

For more details, see https://quanteda.io.

How to Install

You can install it via the normal way from CRAN, using your R GUI or

install.packages("quanteda.textmodels") 

Or for the latest development version:

# devtools package required to install quanteda from Github 
remotes::install_github("quanteda/quanteda.textmodels") 

Because this compiles some C++ and Fortran source code, you will need to have installed the appropriate compilers. On Windows platform, this means the Rtools software available from CRAN, or the macOS tools from macOS tools, including namely the Clang 6.x compiler and the GNU Fortran compiler (as quanteda requires gfortran to build). If you are still getting errors related to gfortran, follow the fixes here.

How to cite

Benoit, Kenneth, Kohei Watanabe, Haiyan Wang, Paul Nulty, Adam Obeng, Stefan Müller, and Akitaka Matsuo. (2018) “quanteda: An R package for the quantitative analysis of textual data”. Journal of Open Source Software. 3(30), 774. https://doi.org/10.21105/joss.00774.

For a BibTeX entry, use the output from citation(package = "quanteda").

Leaving Feedback

If you like quanteda, please consider leaving feedback or a testimonial here.

Contributing

Contributions in the form of feedback, comments, code, and bug reports are most welcome. How to contribute:

Copy Link

Version

Install

install.packages('quanteda.textmodels')

Monthly Downloads

1,878

Version

0.9.9

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

September 3rd, 2024

Functions in quanteda.textmodels (0.9.9)

as.coefficients_textmodel

Coerce various objects to coefficients_textmodel
as.summary.textmodel

Assign the summary.textmodel class to a list
force_conformance

Internal function to match a dfm features to a target set
influence.predict.textmodel_affinity

Compute feature influence from a predicted textmodel_affinity object
data_corpus_EPcoaldebate

Crowd-labelled sentence corpus from a 2010 EP debate on coal subsidies
predict.textmodel_affinity

Prediction for a fitted affinity textmodel
data_corpus_dailnoconf1991

Confidence debate from 1991 Irish Parliament
coef.textmodel_ca

Extract model coefficients from a fitted textmodel_ca object
predict.textmodel_svmlin

Prediction from a fitted textmodel_svmlin object
print.statistics_textmodel

Implements print methods for textmodel_statistics
print.summary.textmodel

print method for summary.textmodel
predict.textmodel_wordfish

Prediction from a textmodel_wordfish method
textmodel_ca

Correspondence analysis of a document-feature matrix
summary.textmodel_svmlin

summary method for textmodel_svmlin objects
predict.textmodel_nb

Prediction from a fitted textmodel_nb object
predict.textmodel_lr

Prediction from a fitted textmodel_lr object
data_corpus_irishbudget2010

Irish budget speeches from 2010
textmodel_lr

Logistic regression classifier for texts
data_corpus_moviereviews

Movie reviews with polarity from Pang and Lee (2004)
summary.textmodel_wordfish

summary method for textmodel_wordfish
summary.textmodel_nb

summary method for textmodel_nb objects
summary.textmodel_svm

summary method for textmodel_svm objects
textmodel_nb

Naive Bayes classifier for texts
predict.textmodel_wordscores

Predict textmodel_wordscores
textmodel_svm

Linear SVM classifier for texts
textplot_influence

Influence plot for text scaling models
predict.textmodel_svm

Prediction from a fitted textmodel_svm object
print.textmodel_wordfish

print method for a wordfish model
print.coefficients_textmodel

Print methods for textmodel features estimates
summary.textmodel_lr

summary method for textmodel_lr objects
textmodel_wordscores

Wordscores text model
textmodel_lsa-postestimation

Post-estimations methods for textmodel_lsa
textmodel_affinity-internal

Internal methods for textmodel_affinity
textmodel_affinity

Class affinity maximum likelihood text scaling model
textmodel_lsa

Latent Semantic Analysis
textmodels

quanteda.textmodels: Scaling Models and Classifiers for Textual Data
textmodel_svmlin

[experimental] Linear SVM classifier for texts
textmodel_wordfish

Wordfish text model
affinity

Internal function to fit the likelihood scaling mixture model.
as.matrix.csr.dfm

convert a dfm into a matrix.csr from SparseM package
as.statistics_textmodel

Coerce various objects to statistics_textmodel