Skip to content

Commit

Permalink
Merge pull request MorvanZhou#27 from Taylor-Swift1/Taylor_Swift
Browse files Browse the repository at this point in the history
Update visual.py to solve 'No Such File or Direction' problem
  • Loading branch information
MorvanZhou authored Dec 13, 2021
2 parents bbd2a37 + b0e5da5 commit 3aa02a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion visual.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ def show_tfidf(tfidf, vocab, filename):
plt.xticks(np.arange(tfidf.shape[1]), vocab, fontsize=6, rotation=90)
plt.yticks(np.arange(tfidf.shape[0]), np.arange(1, tfidf.shape[0]+1), fontsize=6)
plt.tight_layout()
plt.savefig("./visual/results/%s.png" % filename, format="png", dpi=500)
# creating the output folder
output_folder = './visual/results/'
os.makedirs(output_folder, exist_ok=True)
plt.savefig(os.path.join(output_folder, '%s.png') % filename, format="png", dpi=500)
plt.show()


Expand Down

0 comments on commit 3aa02a1

Please sign in to comment.