from yellowbrick.text.postag import postag

machado = [
    [
        [
            ('Last', 'JJ'), ('night', 'NN'), ('as', 'IN'), ('I', 'PRP'),
            ('was', 'VBD'), ('sleeping', 'VBG'), (',', ','), ('I', 'PRP'),
            ('dreamt', 'VBP'), ('—', 'RB'), ('marvelous', 'JJ'), ('error', 'NN'),
            ('!—', 'IN'), ('that', 'DT'), ('I', 'PRP'), ('had', 'VBD'), ('a', 'DT'),
            ('beehive', 'NN'), ('here', 'RB'), ('inside', 'IN'), ('my', 'PRP$'),
            ('heart', 'NN'), ('.', '.')
            ],
        [
            ('And', 'CC'), ('the', 'DT'), ('golden', 'JJ'), ('bees', 'NNS'),
            ('were', 'VBD'), ('making', 'VBG'), ('white', 'JJ'), ('combs', 'NNS'),
            ('and', 'CC'), ('sweet', 'JJ'), ('honey', 'NN'), ('from', 'IN'),
            ('my', 'PRP$'), ('old', 'JJ'), ('failures', 'NNS'), ('.', '.')
            ]
    ]
]

# Create the visualizer, fit, score, and show it
postag(machado)