Skip to content

Commit

Permalink
verbosity + order by name
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomi_h committed Aug 17, 2018
1 parent 189cd4c commit 5969882
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ethically/we/core.py
Expand Up @@ -114,8 +114,8 @@ def _identify_direction(self, positive_end, negative_end,
raise ValueError('positive_end and negative_end'
'should be different, and not the same "{}"'
.format(positive_end))

print('Identify direction using {} method...'.format(method))
if self._verbose:
print('Identify direction using {} method...'.format(method))

direction = None

Expand Down Expand Up @@ -218,8 +218,11 @@ def plot_dist_projections_on_direction(self, word_groups, ax=None):
if ax is None:
_, ax = plt.subplots(1)

for name, words in word_groups.items():
names = sorted(word_groups.keys())

for name in names:
label = '{} (#{})'.format(name, len(words))
words = word_groups[name]
vectors = [self[word] for word in words]
projections = self.model.cosine_similarities(self.direction,
vectors)
Expand Down

0 comments on commit 5969882

Please sign in to comment.