Skip to content

Commit

Permalink
Removing trailing whitespaces in metrics_calculation.py
Browse files Browse the repository at this point in the history
Removing erroneous whitespaces as response to pylint reported errors.
  • Loading branch information
declangroves authored Dec 19, 2022
1 parent fff1b5f commit b7f3563
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions genbit/metrics_calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def _calculate_cooccurrences(self, sentence_tokens):
elif token in self._non_binary_gendered_words:
self._update_all_surrounding_words(
token_index, "non-binary", sentence_tokens)

if token in self._trans_gendered_words:
self._update_all_surrounding_words(
token_index, "trans", sentence_tokens)
Expand Down Expand Up @@ -307,7 +307,7 @@ def _calculate_metrics(self):

for token, metrics in self._cooccurrence_matrix.items():
# only calculate metrics over 'gender neutral' tokens and for
# tokens that have co occurrence counts above the configured cutoff
# tokens that have co occurrence counts above the configured cutoff
if (token not in gender_lists and (self._get_cooccurrence_count(metrics) >= self._cutoff)):
self._tokens_considered += 1
self._bias_scores_ratio[token] = math.log(
Expand Down Expand Up @@ -414,7 +414,7 @@ def _calculate_metrics(self):
max(1, self._gendered_word_counts["female"] + \
self._gendered_word_counts["male"] + \
self._gendered_word_counts["non-binary"]) # avoid devision by 0

overall_metrics.percentage_of_female_gender_definition_words = \
self._gendered_word_counts["female"] / total_gender_definition_words
overall_metrics.percentage_of_male_gender_definition_words = \
Expand Down Expand Up @@ -467,8 +467,8 @@ def _calculate_gender_distribution_divergence(self):
def _get_word_based_metrics(self):
word_based_statistics = {}
gender_lists = self._female_gendered_words.union(self._male_gendered_words, \
self._non_binary_gendered_words, self._trans_gendered_words, self._cis_gendered_words)
for token, values in self._cooccurrence_matrix.items():
self._non_binary_gendered_words, self._trans_gendered_words, self._cis_gendered_words)
for token, values in self._cooccurrence_matrix.items():
if (token not in gender_lists and (self._get_cooccurrence_count(values) >= self._cutoff)):
word_based_gender_statistics = WordBasedGenderStatistics()
word_based_gender_statistics.frequency = values["count"]
Expand Down

0 comments on commit b7f3563

Please sign in to comment.