-
Notifications
You must be signed in to change notification settings - Fork 15
/
README.RMD
64 lines (43 loc) · 2.86 KB
/
README.RMD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
output: github_document
---
```{r, echo=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "##",
fig.path = "man/images/"
)
```
# seededlda: the package for semi-supervised topic modeling
<!-- badges: start -->
[![CRAN
Version](https://www.r-pkg.org/badges/version/seededlda)](https://CRAN.R-project.org/package=seededlda)
[![Downloads](https://cranlogs.r-pkg.org/badges/seededlda)](https://CRAN.R-project.org/package=seededlda)
[![Total
Downloads](https://cranlogs.r-pkg.org/badges/grand-total/seededlda?color=orange)](https://CRAN.R-project.org/package=seededlda)
[![R build
status](https://github.com/koheiw/seededlda/workflows/R-CMD-check/badge.svg)](https://github.com/koheiw/seededlda/actions)
[![codecov](https://codecov.io/gh/koheiw/seededlda/branch/master/graph/badge.svg)](https://codecov.io/gh/koheiw/seededlda)
<!-- badges: end -->
**seededlda** is an R package that implements Seeded LDA (Latent Dirichlet Allocation) for semi-supervised topic modeling based on **quanteda**. Initially, the package was a simple wrapper around the **topicmodels** package, but it was fully rewritten in C++ using the [GibbsLDA++ library](http://gibbslda.sourceforge.net/) and submitted to CRAN as version 0.5 in 2020. The package was further developed to add the sequential classification (Sequential LDA) and parallel computing (Distributed LDA) capabilities and released as version 1.0 in 2023.
## Installation
From CRAN:
```{r, eval=FALSE}
install.packages("seededlda")
```
From Github:
```{r, eval=FALSE}
devtools::install_github("koheiw/seededlda")
```
## Examples
Please visit the package website for examples:
- [Introduction](https://koheiw.github.io/seededlda/articles/pkgdown/basic.html): basic functions of the package
- [Distributed LDA](https://koheiw.github.io/seededlda/articles/pkgdown/distributed.html): topic modeling with parallel computing
- [Seeded LDA](https://koheiw.github.io/seededlda/articles/pkgdown/seeded.html): semi-supervised topic modeling
- [Sequential LDA](https://koheiw.github.io/seededlda/articles/pkgdown/sequential.html): sentence-level topic modeling
Please read the following papers on the algorithms.
- Watanabe, K., & Baturo, A. (2023). Seeded Sequential LDA: A Semi-Supervised Algorithm for Topic-Specific Analysis of Sentences. Social Science Computer Review. https://doi.org/10.1177/08944393231178605
- Watanabe, K. (2023). Speed Up Topic Modeling: Distributed Computing and Convergence Detection for LDA, [working paper](https://blog.koheiw.net/wp-content/uploads/2023/05/Distributed-LDA-02.pdf).
## Other publications
Please read the following papers for how to apply seeded-LDA in social science research:
- Curini, L., & Vignoli, V. (2021). Committed Moderates and Uncommitted Extremists: Ideological Leaning and Parties’ Narratives on Military Interventions in Italy. Foreign Policy Analysis, 17(3), 1–20. https://doi.org/10.1093/fpa/orab016