Skip to content

Commit

Permalink
Downweighted 'fucking' and added 'fuckin' close #20
Browse files Browse the repository at this point in the history
        ## this was done b/c f bomb is more of a valence shifter usually....but
        ## can be a negator.  By making it a small negator it will still pull a
        ## sentence down but if it is paired with 'awesome' the awesome will
        ## outweigh it and the polarity direction will be maintained.  The -in
        ## version is almost always negative (we're more confident)
        ## see: #20
  • Loading branch information
Tyler Rinker committed Oct 19, 2018
1 parent ae5779e commit 6343c7b
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 5 deletions.
6 changes: 6 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ MINOR FEATURES

IMPROVEMENTS

* `hash_sentiment_jockers_rinker` now contains the word 'fuckin'. Additionally,
the word 'fucking' has a milder negative value because this word, though often
used as a negator, is also used as a amplifier. By reducing it's weight it
allows more positive words to have more pull but if no polarized words exist
'fucking' will still keep the typical negative direction of the clause.

CHANGES


6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,11 @@ lexicon 1.0.1 -

**IMPROVEMENTS**

* `hash_sentiment_jockers_rinker` now contains the word 'fuckin'. Additionally,
the word 'fucking' has a milder negative value because this word, though often
used as a negator, is also used as a amplifier. By reducing it's weight it
allows more positive words to have more pull but if no polarized words exist
'fucking' will still keep the typical negative direction of the clause.

**CHANGES**

2 changes: 1 addition & 1 deletion R/hash_sentiment_jockers_rinker.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' @keywords datasets
#' @name hash_sentiment_jockers_rinker
#' @usage data(hash_sentiment_jockers_rinker)
#' @format A data frame with 11,709 rows and 2 variables
#' @format A data frame with 11,710 rows and 2 variables
#' @references Jockers, M. L. (2017). Syuzhet: Extract sentiment and plot arcs
#' from Text. Retrieved from https://github.com/mjockers/syuzhet \cr \cr
#'
Expand Down
1 change: 1 addition & 0 deletions R/lexicon-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
NULL



Binary file modified data/hash_sentiment_jockers_rinker.rda
Binary file not shown.
25 changes: 22 additions & 3 deletions inst/scraping_scripts/sentiment Lexicon Scripts/jockers_rinker.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,31 @@ hash_sentiment_jockers_rinker <- dplyr::bind_rows(
hash_sentiment_jockers,
dplyr::data_frame(
x = c("the shit", "the bomb", "bad ass", "yeah right",
"cut the mustard", "kiss of death"),
y = c(1, 1, 1, -1, 1, -1)
"cut the mustard", "kiss of death", "back handed", "blow smoke",
"blowing smoke", "break a leg", "effing", "in the black",
"in the red", "under the weather"),
y = c(1, 1, 1, -1, 1, -1, -0.5, -0.5, -0.5, 0.5, -0.1, 0.5, -0.5, -0.5)
)
) %>%
sentimentr::as_key()
sentimentr::as_key() %>%
sentimentr::update_key(drop = 'fucking') %>%
sentimentr::update_key(x = dplyr::data_frame(
## this was done b/c f bomb is more of a valence shifter usually....but
## can be a negator. By making it a small negator it will still pull a
## sentence down but if it is paired with 'awesome' the awesome will
## outweigh it and the polarity direction will be maintained. The -in
## version is almost always negative (we're more confident)
## see: https://github.com/trinker/lexicon/issues/20

x = c('fucking', 'fuckin'),
y = c(-.15, -.5)
))

pax::new_data(hash_sentiment_jockers_rinker)


# anti_join(
# lexicon::hash_sentiment_jockers_rinker,
# hash_sentiment_jockers_rinker, by = 'x'
# ) %>%
# dput()
2 changes: 1 addition & 1 deletion man/hash_sentiment_jockers_rinker.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6343c7b

Please sign in to comment.