Learn R Programming

⚠️There's a newer version (0.9.10) of this package.Take me there.

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

Once the package is on CRAN (which is it not yet), then 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 
devtools::install_github("quanteda/quanteda.textmodels") 

Because this compiles some C++ and Fortran source code, you will need to have installed the appropriate compilers.

If you are using a Windows platform, this means you will need also to install the Rtools software available from CRAN.

If you are using macOS, you should install the macOS tools, 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,545

Version

0.9.2

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Kenneth Benoit

Last Published

December 11th, 2020

Functions in quanteda.textmodels (0.9.2)

data_corpus_dailnoconf1991

Confidence debate from 1991 Irish Parliament
predict.textmodel_affinity

Prediction for a fitted affinity textmodel
message_error

Return an error message
data_dfm_lbgexample

dfm from data in Table 1 of Laver, Benoit, and Garry (2003)
force_conformance

Internal function to match a dfm features to a target set
predict.textmodel_nb

Prediction from a fitted textmodel_nb object
print.summary.textmodel

print method for summary.textmodel
predict.textmodel_lr

Prediction from a fitted textmodel_lr object
print.textmodel_wordfish

print method for a wordfish model
summary.textmodel_lr

summary method for textmodel_lr objects
summary.textmodel_nb

summary method for textmodel_nb objects
summary.textmodel_wordfish

summary method for textmodel_wordfish
textmodel_affinity-internal

Internal methods for textmodel_affinity
textmodel_lsa-postestimation

Post-estimations methods for textmodel_lsa
textmodel_lr

Logistic regression classifier for texts
summary.textmodel_svmlin

summary method for textmodel_svmlin objects
textmodel_nb

Naive Bayes classifier for texts
summary.textmodel_svm

summary method for textmodel_svm objects
textmodel_lsa

Latent Semantic Analysis
friendly_class_undefined_message

Print friendly object class not defined message
predict.textmodel_wordscores

Predict textmodel_wordscores
predict.textmodel_wordfish

Prediction from a textmodel_wordfish method
influence.predict.textmodel_affinity

Compute feature influence from a predicted textmodel_affinity object
textmodel_affinity

Class affinity maximum likelihood text scaling model
textmodel_wordfish

Wordfish text model
textplot_scale1d

Plot a fitted scaling model
print.statistics_textmodel

Implements print methods for textmodel_statistics
print.coefficients_textmodel

Print methods for textmodel features estimates This is a helper function used in print.summary.textmodel.
textmodel_svm

Linear SVM classifier for texts
predict.textmodel_svm

Prediction from a fitted textmodel_svm object
predict.textmodel_svmlin

Prediction from a fitted textmodel_svmlin object
unused_dots

Raise warning of unused dots
textmodel_wordscores

Wordscores text model
textmodels

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

(faster) Linear SVM classifier for texts
textplot_influence

Influence plot for text scaling models
textmodel_ca

Correspondence analysis of a document-feature matrix
as.matrix.csr.dfm

convert a dfm into a matrix.csr from SparseM package
data_corpus_EPcoaldebate

Crowd-labelled sentence corpus from a 2010 EP debate on coal subsidies
as.coefficients_textmodel

Coerce various objects to coefficients_textmodel This is a helper function used in summary.textmodel_*.
affinity

Internal function to fit the likelihood scaling mixture model.
as.summary.textmodel

Assign the summary.textmodel class to a list
as.statistics_textmodel

Coerce various objects to statistics_textmodel
data_corpus_irishbudget2010

Irish budget speeches from 2010
coef.textmodel_ca

Extract model coefficients from a fitted textmodel_ca object
data_corpus_moviereviews

Movie reviews with polarity from Pang and Lee (2004)