Python: wordcloud, repetitve words

前端 未结 2 893
说谎
说谎 2020-12-28 20:18

In the word cloud I have repetitive words and I do not understand why they are not counted together and are shown then as one word.

from wordcloud import Wor         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-28 20:42

    If you look at wordcloud.words_ you will see the frequency table includes some two-word phrases like 'oh oh', 'hook start', 'lets go', 'lets hook'.

    You would need to dig into the code behind .process_text() to see exactly why it does this.

    As a work-around you could split word_string yourself to build a word-frequency table, then use .generate_from_frequencies() to create the image.

提交回复
热议问题