Skip to content

Commit

Permalink
Remove encoding check; Python 2 is not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
cgpotts committed Mar 31, 2019
1 parent 8246441 commit 0972552
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions vsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def tsne_viz(df, colors=None, output_filename=None, figsize=(40, 50)):
colors : list of colornames or None (default: None)
Optional list of colors for the vocab. The color names just
need to be interpretable by matplotlib. If they are supplied,
they need to have the same length as rownames. If `colors=None`,
they need to have the same length as `df.index`. If `colors=None`,
then all the words are displayed in black.
output_filename : str (default: None)
If not None, then the output image is written to this location.
Expand Down Expand Up @@ -197,7 +197,6 @@ def tsne_viz(df, colors=None, output_filename=None, figsize=(40, 50)):
# Text labels:
for word, x, y, color in zip(vocab, xvals, yvals, colors):
try:
word = codecs.encode(word, 'utf-8', 'ignore')
ax.annotate(word, (x, y), fontsize=8, color=color)
except UnicodeDecodeError: ## Python 2 won't cooperate!
pass
Expand Down
2 changes: 1 addition & 1 deletion vsm_01_distributional.ipynb

Large diffs are not rendered by default.

0 comments on commit 0972552

Please sign in to comment.