Exercise

Assessing author effort

Often authors will use more words when they are more passionate. For example, a mad airline passenger will leave a longer review the worse (the perceived) service. Conversely a less impassioned passenger may not feel compelled to spend a lot of time writing a review. Lengthy reviews may inflate overall sentiment since the reviews will inherently contain more positive or negative language as the review lengthens. This coding exercise helps to examine effort and sentiment.

In this exercise you will visualize the relationship between effort and sentiment. Recall your rental review tibble contains an id and that a word is represented in each row. As a result a simple count() of the id will capture the number of words used in each review. Then you will join this summary to the positive and negative data. Ultimately you will create a scatter plot that will visualize author review length and its relationship to polarity.

Instructions 1/2

undefined XP
    1
    2
  • Calculate a measure of effort as the count of id.
  • Inner join to the polarity of each review, pos_neg.
  • Mutate to add a pol column. Use ifelse() to set pol to "Positive" if polarity is greater than or equal to zero, else "Negative".