एक वर्ड क्लाउड बनाएँ!

Python में Sentiment Analysis

Violeta Misheva

Data Scientist

वर्ड क्लाउड उदाहरण

काले बैकग्राउंड वाला वर्ड क्लाउड का एक उदाहरण

Python में Sentiment Analysis

वर्ड क्लाउड कैसे काम करते हैं?

 

कोई शब्द जितनी बार आता है, वह वर्ड क्लाउड में उतना ही BIGGER और bolder दिखेगा.

Python में Sentiment Analysis
  • सबसे लंबी समीक्षाओं में से एक से जनरेट किया गया वर्ड क्लाउड

टाइटैनिक की एक समीक्षा से बना गोल आकार का वर्ड क्लाउड

Python में Sentiment Analysis

वर्ड क्लाउड क्यों?

फायदे
  • मुख्य {{1}} दिखा सकता है
  • टेक्स्ट का समग्र अंदाज़ा देता है
  • समझना आसान और आकर्षक
सीमाएँ

  • कभी-कभी उलझाऊ और कम जानकारीपूर्ण
  • बड़े टेक्स्ट पर अधिक मेहनत चाहिए
Python में Sentiment Analysis

Python में वर्ड क्लाउड बनाएँ!

from wordcloud import WordCloud
import matplotlib.pyplot as plt
two_cities = "It was the best of times, it was the worst of times, 
        it was the age of wisdom, it was the age of foolishness, 
        it was the epoch of belief, it was the epoch of incredulity, 
        it was the season of Light, it was the season of Darkness, 
        it was the spring of hope, it was the winter of despair, 
        we had everything before us, we had nothing before us, 
        we were all going direct to Heaven, we were all going
        direct the other way – in short, the period was so far
        like the present period, that some of its noisiest
        authorities insisted on its being received, for good
        or for evil, in the superlative degree of comparison only."
Python में Sentiment Analysis

WordCloud ऑब्जेक्ट परिभाषित करें

cloud_two_cities = WordCloud().generate(two_cities)
# To see all arguments of the function
?WordCloud
  • बैकग्राउंड रंग
  • शब्दों का आकार और फ़ॉन्ट, स्केलिंग
  • स्टॉपवर्ड्स
# cloud_two_cities कैसा दिखता है?
cloud_two_cities
<wordcloud.wordcloud.WordCloud at 0x2585f286d68>
Python में Sentiment Analysis

वर्ड क्लाउड दिखाएँ!

plt.imshow(cloud_two_cities, interpolation='bilinear')
plt.axis('off')
plt.show()

काले बैकग्राउंड वाला वर्ड क्लाउड, "Tale of Two Cities" की पहली पंक्ति से बना

Python में Sentiment Analysis

अभ्यास करते हैं!

Python में Sentiment Analysis

Preparing Video For Download...