Skip to content

Commit

Permalink
update positivity related features
Browse files Browse the repository at this point in the history
  • Loading branch information
xehu committed Aug 8, 2024
1 parent 3b6053a commit bab88b4
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 44 deletions.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/features_conceptual/positivity_bert.doctree
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.. _positivity_bert:

Positivity (BERT)
=================
Sentiment (RoBERTa)
===================

High-Level Intuition
*********************
This feature measures the positivity of a message using BERT's generated valence sentiment markers.
This feature measures the positivity of a message using RoBERTa's generated valence sentiment markers.

Citation
*********
Expand All @@ -17,7 +17,7 @@ The code runs inference on the the Twitter-roBERTa-base-sentiment model to predi

Implementation Notes/Caveats
*****************************
This feature precomputes these valence ratings in the data preprocessing step & stores them locally; this essentially "caches" the sentiment markers, preventing the case where a user spends extra time regenerating these ratings on subsequent requests.
This feature precomputes these valence ratings in the data preprocessing step and stores them locally; this essentially "caches" the sentiment markers, preventing the case where a user spends extra time regenerating these ratings on subsequent requests.


Interpreting the Feature
Expand Down Expand Up @@ -50,4 +50,4 @@ Below is an example output file:

Related Features
*****************
N/A
This feature is one of several that measure sentiment. Other sentiment-related features include Negative_Emotion and Positive_Emotion, which are attributes of :ref:`politeness_receptiveness_markers`; :ref:`textblob_polarity`; and LIWC (a relevant column name being positive_affect_lexical_per_100). A z-scored version of the positivity RoBERTa score is also included separately (:ref:`positivity_z_score`).
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<li class="toctree-l3"><a class="reference internal" href="message_quantity.html">Message Quantity</a></li>
<li class="toctree-l3"><a class="reference internal" href="word_ttr.html">Word Type-Token Ratio</a></li>
<li class="toctree-l3"><a class="reference internal" href="dale_chall_score.html">Dale-Chall Score</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_bert.html">Positivity (BERT)</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_bert.html">Sentiment (RoBERTa)</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_z_score.html">Positivity Z-Score</a></li>
<li class="toctree-l3"><a class="reference internal" href="textblob_polarity.html">Textblob Polarity</a></li>
<li class="toctree-l3"><a class="reference internal" href="textblob_subjectivity.html">Textblob Subjectivity</a></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<li class="toctree-l3"><a class="reference internal" href="message_quantity.html">Message Quantity</a></li>
<li class="toctree-l3"><a class="reference internal" href="word_ttr.html">Word Type-Token Ratio</a></li>
<li class="toctree-l3"><a class="reference internal" href="dale_chall_score.html">Dale-Chall Score</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_bert.html">Positivity (BERT)</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_bert.html">Sentiment (RoBERTa)</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_z_score.html">Positivity Z-Score</a></li>
<li class="toctree-l3"><a class="reference internal" href="textblob_polarity.html">Textblob Polarity</a></li>
<li class="toctree-l3"><a class="reference internal" href="textblob_subjectivity.html">Textblob Subjectivity</a></li>
Expand Down
4 changes: 2 additions & 2 deletions docs/build/html/features_conceptual/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<li class="toctree-l3"><a class="reference internal" href="message_quantity.html">Message Quantity</a></li>
<li class="toctree-l3"><a class="reference internal" href="word_ttr.html">Word Type-Token Ratio</a></li>
<li class="toctree-l3"><a class="reference internal" href="dale_chall_score.html">Dale-Chall Score</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_bert.html">Positivity (BERT)</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_bert.html">Sentiment (RoBERTa)</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_z_score.html">Positivity Z-Score</a></li>
<li class="toctree-l3"><a class="reference internal" href="textblob_polarity.html">Textblob Polarity</a></li>
<li class="toctree-l3"><a class="reference internal" href="textblob_subjectivity.html">Textblob Subjectivity</a></li>
Expand Down Expand Up @@ -122,7 +122,7 @@ <h2>Utterance- (Chat) Level Features<a class="headerlink" href="#utterance-chat-
<li class="toctree-l1"><a class="reference internal" href="message_quantity.html">Message Quantity</a></li>
<li class="toctree-l1"><a class="reference internal" href="word_ttr.html">Word Type-Token Ratio</a></li>
<li class="toctree-l1"><a class="reference internal" href="dale_chall_score.html">Dale-Chall Score</a></li>
<li class="toctree-l1"><a class="reference internal" href="positivity_bert.html">Positivity (BERT)</a></li>
<li class="toctree-l1"><a class="reference internal" href="positivity_bert.html">Sentiment (RoBERTa)</a></li>
<li class="toctree-l1"><a class="reference internal" href="positivity_z_score.html">Positivity Z-Score</a></li>
<li class="toctree-l1"><a class="reference internal" href="textblob_polarity.html">Textblob Polarity</a></li>
<li class="toctree-l1"><a class="reference internal" href="textblob_subjectivity.html">Textblob Subjectivity</a></li>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/features_conceptual/mimicry_bert.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<li class="toctree-l3"><a class="reference internal" href="message_quantity.html">Message Quantity</a></li>
<li class="toctree-l3"><a class="reference internal" href="word_ttr.html">Word Type-Token Ratio</a></li>
<li class="toctree-l3"><a class="reference internal" href="dale_chall_score.html">Dale-Chall Score</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_bert.html">Positivity (BERT)</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_bert.html">Sentiment (RoBERTa)</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_z_score.html">Positivity Z-Score</a></li>
<li class="toctree-l3"><a class="reference internal" href="textblob_polarity.html">Textblob Polarity</a></li>
<li class="toctree-l3"><a class="reference internal" href="textblob_subjectivity.html">Textblob Subjectivity</a></li>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/features_conceptual/moving_mimicry.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<li class="toctree-l3"><a class="reference internal" href="message_quantity.html">Message Quantity</a></li>
<li class="toctree-l3"><a class="reference internal" href="word_ttr.html">Word Type-Token Ratio</a></li>
<li class="toctree-l3"><a class="reference internal" href="dale_chall_score.html">Dale-Chall Score</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_bert.html">Positivity (BERT)</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_bert.html">Sentiment (RoBERTa)</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_z_score.html">Positivity Z-Score</a></li>
<li class="toctree-l3"><a class="reference internal" href="textblob_polarity.html">Textblob Polarity</a></li>
<li class="toctree-l3"><a class="reference internal" href="textblob_subjectivity.html">Textblob Subjectivity</a></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<li class="toctree-l3"><a class="reference internal" href="message_quantity.html">Message Quantity</a></li>
<li class="toctree-l3"><a class="reference internal" href="word_ttr.html">Word Type-Token Ratio</a></li>
<li class="toctree-l3"><a class="reference internal" href="dale_chall_score.html">Dale-Chall Score</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_bert.html">Positivity (BERT)</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_bert.html">Sentiment (RoBERTa)</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_z_score.html">Positivity Z-Score</a></li>
<li class="toctree-l3"><a class="reference internal" href="textblob_polarity.html">Textblob Polarity</a></li>
<li class="toctree-l3"><a class="reference internal" href="textblob_subjectivity.html">Textblob Subjectivity</a></li>
Expand Down
20 changes: 10 additions & 10 deletions docs/build/html/features_conceptual/positivity_bert.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Positivity (BERT) &mdash; Team Communication Toolkit 0.1.1 documentation</title>
<title>Sentiment (RoBERTa) &mdash; Team Communication Toolkit 0.1.1 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=19f00094" />

Expand Down Expand Up @@ -58,7 +58,7 @@
<li class="toctree-l3"><a class="reference internal" href="message_quantity.html">Message Quantity</a></li>
<li class="toctree-l3"><a class="reference internal" href="word_ttr.html">Word Type-Token Ratio</a></li>
<li class="toctree-l3"><a class="reference internal" href="dale_chall_score.html">Dale-Chall Score</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">Positivity (BERT)</a><ul>
<li class="toctree-l3 current"><a class="current reference internal" href="#">Sentiment (RoBERTa)</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#high-level-intuition">High-Level Intuition</a></li>
<li class="toctree-l4"><a class="reference internal" href="#citation">Citation</a></li>
<li class="toctree-l4"><a class="reference internal" href="#implementation-basics">Implementation Basics</a></li>
Expand Down Expand Up @@ -103,7 +103,7 @@
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="index.html">Features: Conceptual Documentation</a></li>
<li class="breadcrumb-item active">Positivity (BERT)</li>
<li class="breadcrumb-item active">Sentiment (RoBERTa)</li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/features_conceptual/positivity_bert.rst.txt" rel="nofollow"> View page source</a>
</li>
Expand All @@ -113,11 +113,11 @@
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<section id="positivity-bert">
<span id="id1"></span><h1>Positivity (BERT)<a class="headerlink" href="#positivity-bert" title="Link to this heading"></a></h1>
<section id="sentiment-roberta">
<span id="positivity-bert"></span><h1>Sentiment (RoBERTa)<a class="headerlink" href="#sentiment-roberta" title="Link to this heading"></a></h1>
<section id="high-level-intuition">
<h2>High-Level Intuition<a class="headerlink" href="#high-level-intuition" title="Link to this heading"></a></h2>
<p>This feature measures the positivity of a message using BERT’s generated valence sentiment markers.</p>
<p>This feature measures the positivity of a message using RoBERTa’s generated valence sentiment markers.</p>
</section>
<section id="citation">
<h2>Citation<a class="headerlink" href="#citation" title="Link to this heading"></a></h2>
Expand All @@ -129,14 +129,14 @@ <h2>Implementation Basics<a class="headerlink" href="#implementation-basics" tit
</section>
<section id="implementation-notes-caveats">
<h2>Implementation Notes/Caveats<a class="headerlink" href="#implementation-notes-caveats" title="Link to this heading"></a></h2>
<p>This feature precomputes these valence ratings in the data preprocessing step &amp; stores them locally; this essentially “caches” the sentiment markers, preventing the case where a user spends extra time regenerating these ratings on subsequent requests.</p>
<p>This feature precomputes these valence ratings in the data preprocessing step and stores them locally; this essentially “caches” the sentiment markers, preventing the case where a user spends extra time regenerating these ratings on subsequent requests.</p>
</section>
<section id="interpreting-the-feature">
<h2>Interpreting the Feature<a class="headerlink" href="#interpreting-the-feature" title="Link to this heading"></a></h2>
<p>This feature returns 3 general sentiment markers: <strong>positive_bert</strong>, <strong>negative_bert</strong>, and <strong>neutral_bert</strong>. Each score ranges from 0-1, and all three scores add up to 1. This feature measures the extent to which a particular utterance aligns with each label, relative to the other labels.</p>
<p>Below is an example output file:</p>
<table class="docutils align-default" id="id2">
<caption><span class="caption-text">Output File</span><a class="headerlink" href="#id2" title="Link to this table"></a></caption>
<table class="docutils align-default" id="id1">
<caption><span class="caption-text">Output File</span><a class="headerlink" href="#id1" title="Link to this table"></a></caption>
<colgroup>
<col style="width: 40.0%" />
<col style="width: 20.0%" />
Expand Down Expand Up @@ -171,7 +171,7 @@ <h2>Interpreting the Feature<a class="headerlink" href="#interpreting-the-featur
</section>
<section id="related-features">
<h2>Related Features<a class="headerlink" href="#related-features" title="Link to this heading"></a></h2>
<p>N/A</p>
<p>This feature is one of several that measure sentiment. Other sentiment-related features include Negative_Emotion and Positive_Emotion, which are attributes of <a class="reference internal" href="politeness_receptiveness_markers.html#politeness-receptiveness-markers"><span class="std std-ref">Politeness Receptiveness Markers</span></a>; <a class="reference internal" href="textblob_polarity.html#textblob-polarity"><span class="std std-ref">Textblob Polarity</span></a>; and LIWC (a relevant column name being positive_affect_lexical_per_100). A z-scored version of the positivity RoBERTa score is also included separately (<a class="reference internal" href="positivity_z_score.html#positivity-z-score"><span class="std std-ref">Positivity Z-Score</span></a>).</p>
</section>
</section>

Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/features_conceptual/word_ttr.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="dale_chall_score.html">Dale-Chall Score</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_bert.html">Positivity (BERT)</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_bert.html">Sentiment (RoBERTa)</a></li>
<li class="toctree-l3"><a class="reference internal" href="positivity_z_score.html">Positivity Z-Score</a></li>
<li class="toctree-l3"><a class="reference internal" href="textblob_polarity.html">Textblob Polarity</a></li>
<li class="toctree-l3"><a class="reference internal" href="textblob_subjectivity.html">Textblob Subjectivity</a></li>
Expand Down
Binary file modified docs/build/html/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/build/html/searchindex.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/source/features_conceptual/positivity_bert.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.. _positivity_bert:

Positivity (BERT)
=================
Sentiment (RoBERTa)
===================

High-Level Intuition
*********************
This feature measures the positivity of a message using BERT's generated valence sentiment markers.
This feature measures the positivity of a message using RoBERTa's generated valence sentiment markers.

Citation
*********
Expand All @@ -17,7 +17,7 @@ The code runs inference on the the Twitter-roBERTa-base-sentiment model to predi

Implementation Notes/Caveats
*****************************
This feature precomputes these valence ratings in the data preprocessing step & stores them locally; this essentially "caches" the sentiment markers, preventing the case where a user spends extra time regenerating these ratings on subsequent requests.
This feature precomputes these valence ratings in the data preprocessing step and stores them locally; this essentially "caches" the sentiment markers, preventing the case where a user spends extra time regenerating these ratings on subsequent requests.


Interpreting the Feature
Expand Down Expand Up @@ -50,4 +50,4 @@ Below is an example output file:

Related Features
*****************
N/A
This feature is one of several that measure sentiment. Other sentiment-related features include Negative_Emotion and Positive_Emotion, which are attributes of :ref:`politeness_receptiveness_markers`; :ref:`textblob_polarity`; and LIWC (a relevant column name being positive_affect_lexical_per_100). A z-scored version of the positivity RoBERTa score is also included separately (:ref:`positivity_z_score`).
11 changes: 3 additions & 8 deletions docs/source/features_conceptual/positivity_z_score.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Citation

Implementation Basics
**********************
A positivity score assined using `RoBERTa Liu et al., (2019) <https://arxiv.org/abs/1907.11692>`_ to calculate two flavors of the z-score:
A positivity score assined using `RoBERTa; Liu et al., (2019) <https://arxiv.org/abs/1907.11692>`_ to calculate two flavors of the z-score:
1. A score of the message with respect to other messages in the same conversation (positivity_zscore_chats)
2. A scores the messages with respect to all messages in the data. (positivity_zscore_conversations)

Expand All @@ -25,13 +25,8 @@ NA
Interpreting the Feature
*************************
Scores can be both negative and positive, with no bounds.
A negative score indicates a the chat is less positive compared to other chats (in the conversation or dataset depending on the feature being used)
, while a positive score indicates a the chat is more positive compared to other chats.
A negative score indicates a the chat is less positive compared to other chats (in the conversation or dataset depending on the feature being used), while a positive score indicates a the chat is more positive compared to other chats.

Related Features
*****************
Other positivity-related features, such as:
1. positive_bert
2. textblob_polarity
3. has_positive
4. Positive_Emotion
This feature is one of several that measure sentiment. Other sentiment-related features include :ref:`positivity_bert`; Negative_Emotion and Positive_Emotion, which are attributes of :ref:`politeness_receptiveness_markers`; :ref:`textblob_polarity`; and LIWC (a relevant column name being positive_affect_lexical_per_100).
8 changes: 1 addition & 7 deletions docs/source/features_conceptual/textblob_polarity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,4 @@ Scores are a continuous variable, ranging from -1 (extremely negative) to 1 (ext

Related Features
*****************
This feature is correlates to other positivity related features such as:

1. positive_bert
2. positivity_zscore_chats
3. positivity_zscore_conversation
4. has_positive
5. Positive_Emotion
This feature is one of several that measure sentiment. Other sentiment-related features include :ref:`positivity_bert`; Negative_Emotion and Positive_Emotion, which are attributes of :ref:`politeness_receptiveness_markers`; and LIWC (a relevant column name being positive_affect_lexical_per_100).

0 comments on commit bab88b4

Please sign in to comment.