Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (21.5%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: odelmarcelle
  • License: gpl-3.0
  • Language: R
  • Default Branch: master
  • Size: 3.32 MB
Statistics
  • Stars: 8
  • Watchers: 1
  • Forks: 2
  • Open Issues: 2
  • Releases: 0
Created over 4 years ago · Last pushed 12 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
always_allow_html: true
---



```{r setup, include=FALSE}
knitr::opts_chunk$set(
  echo = TRUE,
  comment = "#",
  collapse = TRUE,
  fig.path = "man/figures/README-",
  fig.width = 8,
  fig.height = 5
  )
```

# sentopics


[![CRAN Version](https://www.r-pkg.org/badges/version/sentopics)](https://CRAN.R-project.org/package=sentopics)
[![Codecov test coverage](https://codecov.io/gh/odelmarcelle/sentopics/branch/master/graph/badge.svg?token=V6M82L4ZCX)](https://app.codecov.io/gh/odelmarcelle/sentopics)
[![R-CMD-check](https://github.com/odelmarcelle/sentopics/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/odelmarcelle/sentopics/actions/workflows/R-CMD-check.yaml)


## Installation

A stable version `sentopics` is available on CRAN:

```{r eval = FALSE}
install.packages("sentopics")
```

The latest development version can be installed from GitHub:

``` {r eval = FALSE}
devtools::install_github("odelmarcelle/sentopics") 
```

The development version requires the appropriate tools to compile C++ and Fortran source code.

## Basic usage

Using a sample of press conferences from the European Central Bank, an LDA model is easily created from a list of tokenized texts. See https://quanteda.io for details on `tokens` input objects and pre-processing functions.

``` {r}
library("sentopics")
print(ECB_press_conferences_tokens, 2)
set.seed(123)
lda <- LDA(ECB_press_conferences_tokens, K = 3, alpha = .1)
lda <- fit(lda, 100)
lda
```

There are various way to extract results from the model: it is either possible to directly access the estimated mixtures from the `lda` object or to use some helper functions.

```{r paged.print=FALSE}
# The document-topic distributions
head(lda$theta) 
# The document-topic in a 'long' format & optionally with meta-data
head(melt(lda, include_docvars = FALSE))
# The most probable words per topic
top_words(lda, output = "matrix") 
```

Two visualization are also implemented: `plot_top_words()` display the most probable words and `plot()` summarize the topic proportions and their top words.
```{r plot-lda-show, eval = FALSE}
plot(lda)
```
```{r plot-lda, warning=FALSE, fig.align='center', fig.width = 5, echo = FALSE}
plot(lda) |> plotly::layout(width = 500, height = 500)
```



After properly incorporating date and sentiment metadata data (if they are not already present in the `tokens` input), time series functions allows to study the evolution of topic proportions and related sentiment.

```{r series, message=FALSE, out.width="100%"}
sentopics_date(lda)  |> head(2)
sentopics_sentiment(lda) |> head(2)
proportion_topics(lda, period = "month") |> head(2)
plot_sentiment_breakdown(lda, period = "quarter", rolling_window = 3)
```

## Advanced usage

Feel free to refer to the vignettes of the package for a more extensive introduction to the features of the package. Because the package is not yet on CRAN, you'll have to build the vignettes locally.

```{r, eval = FALSE}
vignette("Basic_usage", package = "sentopics")
vignette("Topical_time_series", package = "sentopics")
```

Owner

  • Name: Olivier Delmarcelle
  • Login: odelmarcelle
  • Kind: user

GitHub Events

Total
  • Watch event: 1
  • Issue comment event: 1
  • Push event: 7
  • Pull request event: 2
Last Year
  • Watch event: 1
  • Issue comment event: 1
  • Push event: 7
  • Pull request event: 2

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 149
  • Total Committers: 1
  • Avg Commits per committer: 149.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 20
  • Committers: 1
  • Avg Commits per committer: 20.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
odlmarce d****r@g****m 149

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 3
  • Total pull requests: 3
  • Average time to close issues: 1 day
  • Average time to close pull requests: 5 days
  • Total issue authors: 3
  • Total pull request authors: 1
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.67
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: 5 days
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.67
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ongch (1)
  • almiggggg (1)
  • snvv (1)
Pull Request Authors
  • koheiw (4)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 179 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 7
  • Total maintainers: 1
cran.r-project.org: sentopics

Tools for Joint Sentiment and Topic Analysis of Textual Data

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 179 Last month
Rankings
Stargazers count: 22.5%
Forks count: 28.8%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Average: 35.6%
Downloads: 61.6%
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • Rcpp >= 1.0.4.6 imports
  • RcppHungarian * imports
  • data.table >= 1.13.6 imports
  • methods * imports
  • quanteda >= 3.2.0 imports
  • LDAvis * suggests
  • RColorBrewer * suggests
  • covr * suggests
  • future * suggests
  • future.apply * suggests
  • ggplot2 * suggests
  • ggridges * suggests
  • knitr * suggests
  • lda * suggests
  • plotly * suggests
  • progress * suggests
  • progressr * suggests
  • rmarkdown * suggests
  • seededlda * suggests
  • sentometrics * suggests
  • servr * suggests
  • spacyr * suggests
  • stm * suggests
  • stringr * suggests
  • testthat * suggests
  • textcat * suggests
  • topicmodels * suggests
  • webshot * suggests
  • xts * suggests
  • zoo * suggests
.github/workflows/check-full.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite