Saving nltk drawn parse tree to image file

前端 未结 3 2091
太阳男子
太阳男子 2020-12-01 13:03

\"enter

Is there any way to save the draw image from tree.draw() to an image file prog

3条回答
  •  星月不相逢
    2020-12-01 13:24

    To add to Minjoon's answer, you can change the fonts and colours of the tree to look more like the NLTK .draw() version as follows:

    tc['node_font'] = 'arial 14 bold'
    tc['leaf_font'] = 'arial 14'
    tc['node_color'] = '#005990'
    tc['leaf_color'] = '#3F8F57'
    tc['line_color'] = '#175252'
    

    Before (left) and after (right):

提交回复
热议问题