Repository navigation
Expand file tree
/
Copy pathScrapping of linkedin Skills.py
More file actions
97 lines (51 loc) · 1.55 KB
/
Copy pathScrapping of linkedin Skills.py
File metadata and controls
97 lines (51 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# coding: utf-8
# In[52]:
import requests as rq
# In[3]:
get_ipython().system(u'wget -O skills.txt https://raw.githubusercontent.com/shweteekta/Datasets/master/skills.txt?token=AHRPPY4XUPUG5DTSMSDT5YK5A2DF4')
# In[4]:
data=open('skills.txt','r').read()
# In[5]:
get_ipython().system(u'pip install wordcloud')
from wordcloud import WordCloud, STOPWORDS
# In[6]:
stopwords = set(STOPWORDS)
# In[13]:
ds_wc = WordCloud(
background_color='white',
max_words=200,
stopwords=stopwords
)
# generate the word cloud
ds_wc.generate(data)
# In[22]:
get_ipython().system(u'wget -O dsimage.png https://raw.githubusercontent.com/nikhilkumarsingh/wordcloud-example/master/cloud.png')
# In[23]:
import numpy as np
from PIL import Image
ds_mask = np.array(Image.open('dsimage.png'))
ds_mask
# In[24]:
import matplotlib.pyplot as plt
fig = plt.figure()
fig.set_figwidth(10) # set width
fig.set_figheight(12) # set height
plt.imshow(ds_mask, cmap=plt.cm.gray)
plt.axis('off')
plt.show()
# In[33]:
ds_wc = WordCloud(background_color='white', max_words=3000, mask=ds_mask, stopwords=stopwords)
#stopwords=['practical','theoretical','across','strong','hands','demonstrated','etc']
# generatstope the word cloud
stopwords.add('econometric')
stopwords.add('CART')
stopwords.add('CAID')
ds_wc.generate(data)
fig=plt.figure(figsize=(13,8),facecolor = 'white', edgecolor='blue')
# display the word cloud
#fig = plt.figure()
fig.set_figwidth(13) # set width
fig.set_figheight(12) # set height
plt.imshow(ds_wc,interpolation="bilinear")
plt.axis('off')
plt.show()