In [1]:
%matplotlib inline
from stemgraphic.alpha import stem_graphic
from stemgraphic.stopwords import EN # english stop words
Comparing two Sherlock Holmes stories by Arthur Conan Doyle:
In [2]:
fig, ax = stem_graphic('../datasets/A Case of Identity by Arthur Conan Doyle.txt',
'../datasets/The Red Headed League by Arthur Conan Doyle.txt',
alpha_only=True, stop_words=EN, caps=False, random_state=42)
Saving as PNG:
In [3]:
fig.savefig('b2b_stem_graphic.png', bbox_inches='tight')
In [ ]: