Skip to content
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

Bring your own LIWC & matplotlib dependency fix #322

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/feature_builder.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/features/lexical_features_v2.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/utils/calculate_chat_level_features.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/utils/check_embeddings.doctree
Binary file not shown.
3 changes: 2 additions & 1 deletion docs/build/html/feature_builder.html

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/build/html/features/lexical_features_v2.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@

<dl class="py function">
<dt class="sig sig-object py" id="features.lexical_features_v2.liwc_features">
<span class="sig-prename descclassname"><span class="pre">features.lexical_features_v2.</span></span><span class="sig-name descname"><span class="pre">liwc_features</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">chat_df</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">message_col</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">DataFrame</span></span></span><a class="headerlink" href="#features.lexical_features_v2.liwc_features" title="Link to this definition"></a></dt>
<span class="sig-prename descclassname"><span class="pre">features.lexical_features_v2.</span></span><span class="sig-name descname"><span class="pre">liwc_features</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">chat_df</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">message_col</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">custom_liwc_dictionary</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">{}</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">DataFrame</span></span></span><a class="headerlink" href="#features.lexical_features_v2.liwc_features" title="Link to this definition"></a></dt>
<dd><blockquote>
<div><p>This function takes in the chat level input dataframe and computes lexical features
(the number of words from a given lexicon, such as LIWC).</p>
Expand All @@ -146,6 +146,7 @@
<dd class="field-odd"><ul class="simple">
<li><p><strong>chat_df</strong> (<em>pd.DataFrame</em>) – This is a pandas dataframe of the chat level features. Should contain ‘message’ column.</p></li>
<li><p><strong>message_col</strong> (<em>str</em>) – This is a string with the name of the column containing the message / text.</p></li>
<li><p><strong>custom_liwc_dictionary</strong> (<em>dict</em>) – This is a dictionary of the user’s custom LIWC dic.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
Expand Down
4 changes: 4 additions & 0 deletions docs/build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ <h2 id="F">F</h2>
</li>
</ul></li>
<li><a href="feature_builder.html#feature_builder.FeatureBuilder.featurize">featurize() (feature_builder.FeatureBuilder method)</a>
</li>
<li><a href="utils/check_embeddings.html#utils.check_embeddings.fix_abbreviations">fix_abbreviations() (in module utils.check_embeddings)</a>
</li>
<li><a href="features/word_mimicry.html#features.word_mimicry.function_mimicry_score">function_mimicry_score() (in module features.word_mimicry)</a>
</li>
Expand Down Expand Up @@ -621,6 +623,8 @@ <h2 id="L">L</h2>
<li><a href="utils/calculate_chat_level_features.html#utils.calculate_chat_level_features.ChatLevelFeaturesCalculator.lexical_features">lexical_features() (utils.calculate_chat_level_features.ChatLevelFeaturesCalculator method)</a>
</li>
<li><a href="features/lexical_features_v2.html#features.lexical_features_v2.liwc_features">liwc_features() (in module features.lexical_features_v2)</a>
</li>
<li><a href="utils/check_embeddings.html#utils.check_embeddings.load_liwc_dict">load_liwc_dict() (in module utils.check_embeddings)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
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.

8 changes: 6 additions & 2 deletions docs/build/html/utils/calculate_chat_level_features.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<span id="calculate-chat-level-features-module"></span><span id="chat-level-features"></span><h1>calculate_chat_level_features module<a class="headerlink" href="#module-utils.calculate_chat_level_features" title="Link to this heading"></a></h1>
<dl class="py class">
<dt class="sig sig-object py" id="utils.calculate_chat_level_features.ChatLevelFeaturesCalculator">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">utils.calculate_chat_level_features.</span></span><span class="sig-name descname"><span class="pre">ChatLevelFeaturesCalculator</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">chat_data</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vect_data</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bert_sentiment_data</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ner_training</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ner_cutoff</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">conversation_id_col</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">message_col</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timestamp_col</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utils.calculate_chat_level_features.ChatLevelFeaturesCalculator" title="Link to this definition"></a></dt>
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">utils.calculate_chat_level_features.</span></span><span class="sig-name descname"><span class="pre">ChatLevelFeaturesCalculator</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">chat_data</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vect_data</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bert_sentiment_data</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ner_training</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ner_cutoff</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">conversation_id_col</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">message_col</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timestamp_col</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">custom_liwc_dictionary</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utils.calculate_chat_level_features.ChatLevelFeaturesCalculator" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Initialize variables and objects used by the ChatLevelFeaturesCalculator class.</p>
<p>This class uses various feature modules to define chat-level features. It reads input data and
Expand All @@ -107,8 +107,12 @@
<li><p><strong>chat_data</strong> (<em>pd.DataFrame</em>) – Pandas dataframe of chat-level features read from the input dataset</p></li>
<li><p><strong>vect_data</strong> (<em>pd.DataFrame</em>) – Pandas dataframe containing vector data</p></li>
<li><p><strong>bert_sentiment_data</strong> (<em>pd.DataFrame</em>) – Pandas dataframe containing BERT sentiment data</p></li>
<li><p><strong>ner_training_df</strong> (<em>pd.DataFrame</em>) – This is a pandas dataframe of training data for named entity recognition feature</p></li>
<li><p><strong>ner_training</strong> (<em>pd.DataFrame</em>) – This is a pandas dataframe of training data for named entity recognition feature</p></li>
<li><p><strong>ner_cutoff</strong> (<em>int</em>) – This is the cutoff value for the confidence of prediction for each named entity</p></li>
<li><p><strong>conversation_id_col</strong> (<em>str</em>) – A string representing the column name that should be selected as the conversation ID. Defaults to “conversation_num”.</p></li>
<li><p><strong>message_col</strong> (<em>str</em>) – A string representing the column name that should be selected as the message. Defaults to “message”.</p></li>
<li><p><strong>timestamp_col</strong> (<em>str</em>) – A string representing the column name that should be selected as the message. Defaults to “timestamp”.</p></li>
<li><p><strong>custom_liwc_dictionary</strong> (<em>dict</em>) – This is the user’s own LIWC dictionary. Defaults to empty dictionary.</p></li>
</ul>
</dd>
</dl>
Expand Down
Loading
Loading