How to Create a Wordcloud with Python

Sdílet
Vložit
  • čas přidán 8. 09. 2024
  • In this video, we're going to show you how to create a Python word cloud from World Cup Tweets. This is a great way to see the most popular words tweeted about the World Cup by fans around the world!
    Word clouds are a great way to see the most frequent words used in a given dataset. In this video, we'll show you how to create a Python word cloud from World Cup Tweets and use it to get a sense of the content of the tweets. After watching this video, you'll be able to create your own word clouds using Python!
    The code and data used in this how to make a world cloud in python video is available from GitHub and can be accessed from the link below.
    github.com/Sup...

Komentáře • 11

  • @findthetruth3021
    @findthetruth3021 Před rokem +1

    It was awsome, but could you please make a video of how did you get the sentiment analysis. Thanks in advance.

    • @analyticswithadam
      @analyticswithadam  Před rokem +2

      Im going to do one eventually on the project. In the meantime this video lays out the method really good czcams.com/video/QpzMWQvxXWk/video.html .. Just follow the Roberta bit , found the Vaders model didnt work well...

    • @findthetruth3021
      @findthetruth3021 Před rokem

      @@analyticswithadam Thanks a lot for the prompt response.

  • @maxparsons9431
    @maxparsons9431 Před rokem

    I was able to create the wordcloud, but was wondering how I could get two words to stay together without leaving out the space between them. I want to create a cloud that uses first and last names of people. So an example would be John Doe but I want them together and not spread out across the cloud, is that possible?

    • @analyticswithadam
      @analyticswithadam  Před rokem +1

      You could try something lile this but you would have to designate the names.
      from wordcloud import WordCloud
      import matplotlib.pyplot as plt
      # text with multi-word phrases
      text = "John Doe is a software engineer. John Doe likes to code. Jane Smith is a doctor. Jane Smith likes to read."
      # replace spaces in multi-word phrases with underscores
      text = text.replace('John Doe', 'John_Doe').replace('Jane Smith', 'Jane_Smith')
      # generate word cloud
      wordcloud = WordCloud().generate(text)
      # display the generated image
      plt.imshow(wordcloud, interpolation='bilinear')
      plt.axis("off")
      plt.show()

    • @maxparsons9431
      @maxparsons9431 Před rokem

      @@analyticswithadam thank you for the speedy response, I will try this when I get home!

    • @maxparsons9431
      @maxparsons9431 Před rokem

      @@analyticswithadam is it possible for a wordcloud to use multiple fonts, like the words have a randomized chance on which font they use?

    • @analyticswithadam
      @analyticswithadam  Před rokem +1

      @@maxparsons9431 technically it is possible but it would be quite hard, essentially overlaying two images of seperate wordclouds on top of each other. You cant do it directly in the params as far as I know.

    • @maxparsons9431
      @maxparsons9431 Před rokem

      @@analyticswithadam oh well, thanks again for the response!

  • @veenakosale_cse_sstc5673

    I am trying to import word cloud in Jupyter notebook but it did not work. Also, I tried to install the package but it did not work too. Please help me to solve this issue.

    • @analyticswithadam
      @analyticswithadam  Před rokem

      Try to copy and paste code exactly. If it works then the setup is good, just change the csv and you are good to go.
      github.com/SuperDataWorld/Screenshots/blob/main/WC.ipynb