-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KWIC highlighting working only 50% for kwic derived from partition #38
Comments
The issue is not very informative. This is definitely missing: SentiWS <- get_sentiws()
words_positive <- unique(SentiWS[weight > 0][["word"]])
words_negative <- unique(SentiWS[weight < 0][["word"]]) The colors are dropped, and this what needs to be addressed... |
Critizising myself, I need to note that I repeatedly failed to offer a reproducible example. Now I think that my initial diagnosis was wrong: Colors were not dropped, but in the example, there were previously assigned colors for the words on the positivelist (in the I think, the error is that library(polmineR)
library(magrittr)
use("GermaParl")
gist_url <- "https://gist.githubusercontent.com/PolMine/70eeb095328070c18bd00ee087272adf/raw/c2eee2f48b11e6d893c19089b444f25b452d2adb/sentiws.R"
devtools::source_url(gist_url) # danach ist Funktion verfügbar
SentiWS <- get_sentiws()
SentiWS <- get_sentiws()
words_positive <- unique(SentiWS[weight > 0][["word"]])
words_negative <- unique(SentiWS[weight < 0][["word"]])
df <- partition("GERMAPARL", year = 2001:2011) %>%
context(query = "Islam", p_attribute = c("word", "pos"), verbose = FALSE) %>%
partition_bundle(node = FALSE) %>%
set_names(s_attributes(., s_attribute = "date")) %>%
weigh(with = SentiWS) %>%
summary()
y <- partition("GERMAPARL", year = 2001:2011) %>%
kwic(query = "Islam", positivelist = c(words_positive, words_negative)) %>%
highlight(lightgreen = words_positive, orange = words_negative) %>%
tooltips(setNames(SentiWS[["word"]], SentiWS[["weight"]])) %>%
as("htmlwidget")
show(y) I am about to push polmineR v0.7.11.9030 that will solve this issue. |
The text was updated successfully, but these errors were encountered: