from wordcloud import WordCloud
import matplotlib.pyplot as plt
text=open('AI2017.txt','r').read()
font=r'c:\Windows\Fonts\simfang.ttf'
wc=WordCloud(font_path=font,width=800,height=600).generate(text)
plt.imshow(wc)
plt.axis('off')
plt.show()
wc.to_file('AI.jpg')