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.3

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Kenneth Benoit

Last Published

March 7th, 2021

Functions in quanteda.textmodels (0.9.3)

data_corpus_dailnoconf1991

Confidence debate from 1991 Irish Parliament
data_corpus_EPcoaldebate

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

Prediction from a fitted textmodel_nb object
affinity

Internal function to fit the likelihood scaling mixture model.
summary.textmodel_lr

summary method for textmodel_lr objects
predict.textmodel_lr

Prediction from a fitted textmodel_lr object
message_error

Return an error message
data_corpus_irishbudget2010

Irish budget speeches from 2010
as.matrix.csr.dfm

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

Print friendly object class not defined message
as.summary.textmodel

Assign the summary.textmodel class to a list
predict.textmodel_affinity

Prediction for a fitted affinity textmodel
textmodel_lr

Logistic regression classifier for texts
coef.textmodel_ca

Extract model coefficients from a fitted textmodel_ca object
textmodel_wordfish

Wordfish text model
summary.textmodel_nb

summary method for textmodel_nb objects
influence.predict.textmodel_affinity

Compute feature influence from a predicted textmodel_affinity object
predict.textmodel_svm

Prediction from a fitted textmodel_svm object
textmodel_wordscores

Wordscores text model
predict.textmodel_svmlin

Prediction from a fitted textmodel_svmlin object
textmodel_lsa-postestimation

Post-estimations methods for textmodel_lsa
textmodel_svm

Linear SVM classifier for texts
data_dfm_lbgexample

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

quanteda.textmodels: Scaling Models and Classifiers for Textual Data
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.
force_conformance

Internal function to match a dfm features to a target set
print.summary.textmodel

print method for summary.textmodel
textmodel_lsa

Latent Semantic Analysis
textplot_influence

Influence plot for text scaling models
summary.textmodel_svm

summary method for textmodel_svm objects
summary.textmodel_svmlin

summary method for textmodel_svmlin objects
predict.textmodel_wordfish

Prediction from a textmodel_wordfish method
textmodel_nb

Naive Bayes classifier for texts
textmodel_svmlin

[experimental] Linear SVM classifier for texts
unused_dots

Raise warning of unused dots
print.textmodel_wordfish

print method for a wordfish model
predict.textmodel_wordscores

Predict textmodel_wordscores
summary.textmodel_wordfish

summary method for textmodel_wordfish
textmodel_affinity-internal

Internal methods for textmodel_affinity
textmodel_affinity

Class affinity maximum likelihood text scaling model
textmodel_ca

Correspondence analysis of a document-feature matrix
as.coefficients_textmodel

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

Movie reviews with polarity from Pang and Lee (2004)
as.statistics_textmodel

Coerce various objects to statistics_textmodel