https://github.com/koheiw/quanteda.features
Implements opinion featuring in https://arxiv.org/abs/2001.09879
https://github.com/koheiw/quanteda.features
Last synced: about 1 month ago
JSON representation
Implements opinion featuring in https://arxiv.org/abs/2001.09879
- Host: GitHub
- URL: https://github.com/koheiw/quanteda.features
- Owner: koheiw
- License: other
- Created: 2019-06-21T09:31:22.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-07T16:21:54.000Z (almost 6 years ago)
- Last Synced: 2025-02-15T02:43:48.311Z (3 months ago)
- Language: C++
- Homepage:
- Size: 3.31 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r, echo=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "##",
fig.path = "man/images/"
)
``````{r, message=FALSE}
require(quanteda)
require(quanteda.features)
toks <- tokens(tail(data_corpus_irishbudget2010, 20))
dict <- dictionary(file = "/home/kohei/Documents/Dictionary/Lexicoder/policy_agendas_english.lcd")
``````{r}
dfm_opinions(toks, dict, data_dictionary_LSD2015[1:2], window = 100) %>%
as.matrix()
``````{r}
dfm_opinions(toks, dict, data_dictionary_LSD2015[1:2], window = 100) %>%
#as.matrix()
textstat_dist() %>%
as.dist() %>%
hclust() %>%
plot()
``````{r}
dfm(toks, remove = stopwords()) %>%
textstat_dist() %>%
as.dist() %>%
hclust() %>%
plot()
```