├── .idea
├── encodings.xml
├── inspectionProfiles
│ └── profiles_settings.xml
├── markdown-navigator-enh.xml
├── markdown-navigator.xml
├── misc.xml
├── modules.xml
├── workspace.xml
└── 项目.iml
├── README.md
├── charts
├── ParseNews.py
└── WordMap.py
├── normal
├── article.py
├── curvefit.py
├── 代码分析.md
└── 代码结构.png
├── scripts
├── crawler
│ ├── bilibili_crawler.py
│ ├── sina_crawler.py
│ └── test.py
└── data_process
│ ├── charts.py
│ ├── data_filter.py
│ ├── nlp.py
│ ├── nlp_test.py
│ └── test.py
├── stopwords
├── baidu_stopwords.txt
├── cn_stopwords.txt
├── hit_stopwords.txt
└── scu_stopwords.txt
└── 源码分析
├── img
├── image-20210119174014054.png
├── image-20210119222637859.png
├── image-20210119222750738.png
├── image-20210119222820365.png
├── image-20210119223019946.png
├── image-20210119223044549.png
├── image-20210119223143176.png
├── image-20210119223308316.png
├── image-20210119223409484.png
├── image-20210119223432546.png
├── image-20210119223712935.png
└── image-20210119223728526.png
└── 数据科学大作业-源码分析.md
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/markdown-navigator-enh.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/.idea/markdown-navigator.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
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 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 | 1607750630317
168 |
169 |
170 | 1607750630317
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
--------------------------------------------------------------------------------
/.idea/项目.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # README
2 |
3 | > 基于爬取疫情期间新浪新闻评论、b站弹幕,运用NLP技术进行社会舆论分析的练习项目
4 |
5 | 代码贡献者:
6 |
7 | Carl-yan-bit
8 |
9 | RubiscoQAQ
10 |
11 | skywords7
12 |
13 | 源码分析:在源码分析文件夹中
14 |
15 | 数据集:链接: https://pan.baidu.com/s/1sSeZMyRkpsP5O6WEbbYWsw 提取码: xwap
16 |
17 |
--------------------------------------------------------------------------------
/charts/ParseNews.py:
--------------------------------------------------------------------------------
1 | import json
2 |
3 | from pyecharts.charts import Pie
4 | from pyecharts import options
5 | from pyecharts.charts import Page
6 | from pyecharts.charts import Bar
7 | from pyecharts.charts import Line
8 | from pyecharts.charts import Bar3D
9 | from pyecharts.faker import Faker
10 |
11 |
12 | def load_files(path):
13 | with open(path, 'r') as f:
14 | return json.load(f)
15 |
16 |
17 | def arrangeByTime(news):
18 | daily = dict()
19 | monthly = dict()
20 | days = dict()
21 | news_list = {"daily": daily, "monthly": monthly, "days": days}
22 | times = 0
23 | day3 = []
24 | for year in range(2019, 2021):
25 | for month in range(1, 13):
26 | mon = tostr(year) + "-" + tostr(month)
27 | monLst = []
28 | for day in range(1, 32):
29 | date = tostr(year) + "-" + tostr(month) + "-" + tostr(day)
30 | lst = []
31 | for new in news:
32 | if new["create_date"] == date:
33 | lst.append(new)
34 | monLst.append(new)
35 | day3.append(new)
36 | times += 1
37 | if times == 3:
38 | if len(day3) != 0:
39 | days[date] = day3
40 | day3 = []
41 | times = 0
42 | if len(lst) != 0:
43 | daily[date] = lst
44 | if len(monLst) != 0:
45 | monthly[mon] = monLst
46 | return news_list
47 |
48 |
49 | def arrangeByChannel(news):
50 | channel = dict()
51 | for new in news:
52 | if new['channel'] not in channel.keys():
53 | channel[new['channel']] = []
54 | channel[new['channel']].append(new)
55 | else:
56 | channel[new['channel']].append(new)
57 | return channel
58 |
59 |
60 | def tostr(num):
61 | st = str(num)
62 | if len(st) == 1:
63 | st = "0" + st
64 | return st
65 |
66 |
67 | def trans(labels):
68 | for i in range(0, len(labels)):
69 | labels[i] = tran(labels[i])
70 | return labels
71 |
72 |
73 | def tran(key):
74 | dic = {'gn': '国内', 'sh': '社会', 'ty': '体育', 'mp': '看点', 'live': '直播', 'cj': '财经', 'kj': '科技', 'gj': '国际'
75 | , 'yl': '娱乐', 'jc': '军事', 'js': '江苏', 'jilin': '吉林', 'video': '视频'}
76 | return dic.get(key)
77 |
78 |
79 | def drawCycle(dic):
80 | # page = Page()
81 | pie = Pie()
82 | pie.set_global_opts(title_opts=options.TitleOpts(title="新浪新闻主题", pos_top='55'))
83 | a = []
84 | for i in dic.keys():
85 | a.append((tran(i), len(dic.get(i))))
86 | pie.add('总数', a)
87 | # page.add(pie)
88 | # page.page_title = "新浪新闻主题分布"
89 | # page.render("NewPage/主题分布.html")
90 | return pie
91 |
92 |
93 | def divideComment(news):
94 | comment = []
95 | for new in news:
96 | comment += new['hot_comment_list']
97 | return comment
98 |
99 |
100 | def getMood(comments, mode):
101 | mood = dict()
102 | for i in comments.keys():
103 | sum = 0
104 | times = 0
105 | if len(comments.get(i)) == 0:
106 | continue
107 | for j in comments.get(i):
108 | if mode == 0:
109 | temp = str(j['sentiment'])
110 | if not temp.__contains__("."):
111 | continue
112 | times += 1
113 | sum += float(temp)
114 | else:
115 | temp = str(j['sentiment'])
116 | if not temp.__contains__("."):
117 | continue
118 | agree = str(j['agree'])
119 | if not agree.isdigit():
120 | continue
121 | times += max(int(agree), 1)
122 | sum += float(temp) * max(int(agree), 1)
123 | mood[i] = str.format("{:.3f}", sum / times)
124 | return mood
125 |
126 |
127 | def numMap(data):
128 | x_data = data.keys()
129 | y_data = []
130 | for i in x_data:
131 | y_data.append(data.get(i))
132 | bar = Bar()
133 | bar.add_xaxis(trans(list(x_data)))
134 | bar.add_yaxis("评论情感", y_data)
135 | # bar.render("NewPage/评论平均情感.html")
136 | bar.set_global_opts(title_opts=options.TitleOpts(title="评论平均情感", pos_top='55'))
137 | return bar
138 |
139 |
140 | def drawChannelMotion(news):
141 | comment_channel = dict()
142 | for i in news.keys():
143 | comment_channel[i] = divideComment(news.get(i))
144 | numMap(getMood(comment_channel, 0))
145 |
146 |
147 | def drawDailyNewsNum(news, mode):
148 | line = Line()
149 | line.add_xaxis(list(news.get(mode).keys()))
150 | y = []
151 | for i in news.get(mode).keys():
152 | y.append(len(news.get(mode).get(i)))
153 | line.add_yaxis("新闻数量", y_axis=y)
154 | # line.render("NewPage/新闻每月数.html")
155 | line.set_global_opts(title_opts=options.TitleOpts(title=titleTransform("新浪新闻" + str(mode) + "数量"), pos_top='55'))
156 | return line
157 |
158 |
159 | def parseComment(path):
160 | str = []
161 | with open(path, 'r', encoding='utf-8') as f:
162 | temp = f.readline()
163 | while temp != "":
164 | temp = temp[:-1]
165 | str.append(temp)
166 | temp = f.readline()
167 | for i in range(0, len(str)):
168 | str[i] = str[i].split(",")
169 | return str
170 |
171 |
172 | def getDailyComment(comments, limit, kind):
173 | daily = dict()
174 | if kind == 'b':
175 | for year in range(2019, 2021):
176 | month = 1
177 | while month <= 12:
178 | day = 1
179 | while day <= 31:
180 | date = tostr(year) + "-" + tostr(month) + "-" + tostr(day)
181 | idx = date
182 | for i in range(0, limit):
183 | lst = []
184 | for comment in comments:
185 | if comment[0] == date:
186 | lst.append(comment)
187 | if len(lst) != 0:
188 | daily[idx] = lst
189 | day += 1
190 | date = tostr(year) + "-" + tostr(month) + "-" + tostr(day)
191 | if day > 31:
192 | month += 1
193 | if month > 12:
194 | break
195 | day -= 31
196 | date = tostr(year) + "-" + tostr(month) + "-" + tostr(day)
197 | print(date)
198 | return daily
199 | for year in range(2019, 2021):
200 | month = 1
201 | while month <= 12:
202 | day = 1
203 | while day <= 31:
204 | date = str(year) + "/" + str(month) + "/" + str(day)
205 | idx = date
206 | for i in range(0, limit):
207 | lst = []
208 | for comment in comments:
209 | if comment[0] == date:
210 | lst.append(comment)
211 | if len(lst) != 0:
212 | daily[idx] = lst
213 | day += 1
214 | date = str(year) + "/" + str(month) + "/" + str(day)
215 | if day > 31:
216 | month += 1
217 | if month > 12:
218 | break
219 | day -= 31
220 | date = str(year) + "/" + str(month) + "/" + str(day)
221 | print(date)
222 | return daily
223 |
224 |
225 | def getValue(lst, mode, kind):
226 | sum = 0.0
227 | times = 0.0
228 | if kind == 'b':
229 | if mode == 1:
230 | mode = 0
231 | tar = 2
232 | else:
233 | tar = 3
234 | if mode == 0:
235 | for i in lst:
236 | if not i[tar].__contains__("."):
237 | print(i[tar])
238 | continue
239 | sum += float(i[tar])
240 | times += 1
241 | else:
242 | for i in lst:
243 | if not i[2].__contains__("."):
244 | print(i[2])
245 | continue
246 | if not i[3].__contains__("."):
247 | print(i[2])
248 | continue
249 | sum += float(i[3]) * max(float(i[2]), 1)
250 | times += max(float(i[2]), 1)
251 | return str.format("{:.3f}", sum / times)
252 |
253 |
254 | def parseMood(dic, mode, limit, port):
255 | x_data = dic.keys()
256 | y_data = []
257 | print(x_data)
258 | x = []
259 | for i in x_data:
260 | x.append(i[5:])
261 | y_data.append(getValue(dic.get(i), mode, port))
262 | line = Line()
263 | if port == 'b':
264 | port = 'B站'
265 | else:
266 | port = '新浪'
267 | line.add_xaxis(x).add_yaxis("情感变化", y_data, )
268 | # line.render("NewPage/" + str(mode) + "评论情感每" + str(limit) + "天.html")
269 | line.set_global_opts(title_opts=options.TitleOpts(title=titleTransform(port+"评论情感每" + str(limit) + "天"), pos_top='55'))
270 | return line
271 |
272 |
273 | def bilibili_comment():
274 | lst = parseComment("bilibili/bilibili弹幕全集-predicted.csv")
275 | # for j in range(0, 2):
276 | pie = []
277 | for i in [1, 3, 7, 30]:
278 | day = getDailyComment(lst, i, 'b')
279 | pie.append(parseMood(day, 0, i, 'b'))
280 | return pie
281 |
282 | def sina_all_comment():
283 | lst = parseComment("sina/新浪所有排行新闻评论全集-predicted.csv")
284 | pie = []
285 | for i in [1, 3, 7, 30]:
286 | day = getDailyComment(lst, i, 's')
287 | pie.append(parseMood(day, 1, i, 's'))
288 | return pie
289 |
290 |
291 | def sina_comment(data, mode, time):
292 | line = Line()
293 | temp = list(arrangeByTime(data).get(time).keys())
294 | line.add_xaxis(temp)
295 | data = arrangeByChannel(data) # 按频道分
296 | news = dict()
297 | for i in data.keys():
298 | news[i] = arrangeByTime(data.get(i)).get(time)
299 | value = dict()
300 | comment_channel = dict()
301 | for i in news.keys():
302 | comment_channel[i] = dict()
303 | value[i] = dict()
304 | for j in news[i].keys():
305 | comment_channel[i][j] = divideComment(news[i].get(j))
306 | value[i] = getMood(comment_channel[i], mode)
307 | for i in value.keys():
308 | y = []
309 | for j in temp:
310 | if j in value.get(i).keys():
311 | y.append(value.get(i).get(j))
312 | else:
313 | y.append(None)
314 | if i not in ['js', 'jilin', 'video', 'live']:
315 | line.add_yaxis(tran(i), y, is_connect_nones=True, is_symbol_show=(time == 'monthly'))
316 | # line.render("NewPage/无权每月评论.html")
317 | line.set_global_opts(title_opts=options.TitleOpts(title=titleTransform("新浪新闻评论"+str(mode) + str(time) + "评论情感分析"), pos_top='55'))
318 | return line
319 |
320 |
321 | def commentChannel(data, time):
322 | line = Line()
323 | temp = list(arrangeByTime(data).get(time).keys())
324 | line.add_xaxis(temp)
325 | data = arrangeByChannel(data) # 按频道分
326 | news = dict()
327 | for i in data.keys():
328 | news[i] = arrangeByTime(data.get(i)).get(time)
329 | comment_channel = dict()
330 | for i in news.keys():
331 | comment_channel[i] = dict()
332 | for j in news[i].keys():
333 | comment_channel[i][j] = divideComment(news[i].get(j))
334 | for i in comment_channel.keys():
335 | y = []
336 | for j in temp:
337 | if j in comment_channel.get(i).keys():
338 | y.append(len(comment_channel.get(i).get(j)))
339 | else:
340 | y.append(None)
341 | if i not in ['js', 'jilin', 'video', 'live']:
342 | line.add_yaxis(tran(i), y, is_connect_nones=True, is_symbol_show=(time == 'monthly'))
343 | # line.render("NewPage/无权每月评论.html")
344 | line.set_global_opts(title_opts=options.TitleOpts(title=titleTransform("新浪新闻评论"+str(time) + "评论数量"), pos_top='55'))
345 | return line
346 |
347 |
348 | def titleTransform(title):
349 | title = str(title)
350 | title = title.replace("daily", "每天").replace("days", "每十二天").replace("monthly", "每月").replace("1天", "天").replace("30天", "月").replace("0", "无点赞权重").replace("1", "")
351 | return title
352 |
353 |
354 | def drawThreeD(data, mode, time):
355 | bar3d = Bar3D()
356 | temp = list(arrangeByTime(data).get(time).keys())
357 | res = []
358 | data = arrangeByChannel(data) # 按频道分
359 | news = dict()
360 | for i in data.keys():
361 | news[i] = arrangeByTime(data.get(i)).get(time)
362 | value = dict()
363 | comment_channel = dict()
364 | for i in news.keys():
365 | comment_channel[i] = dict()
366 | value[i] = dict()
367 | for j in news[i].keys():
368 | comment_channel[i][j] = divideComment(news[i].get(j))
369 | value[i] = getMood(comment_channel[i], mode)
370 | for i in value.keys():
371 | if i in ['js', 'jilin', 'video', 'live']:
372 | continue
373 | if len(value.get(i))==0:
374 | continue
375 | for j in temp:
376 | if j in value.get(i).keys():
377 | res.append((tran(i), j, value.get(i).get(j)))
378 | else:
379 | res.append((tran(i), j, None))
380 | bar3d.add(
381 | "",
382 | [[d[1], d[0], d[2]] for d in res],
383 | ).set_global_opts(
384 | visualmap_opts=options.VisualMapOpts(max_=1),
385 | title_opts=options.TitleOpts(title="时间、维度与新浪评论情感总图"),
386 | )
387 | return bar3d
388 |
389 | #for i in value.keys():
390 | # y = []
391 | # for j in temp:
392 | # if j in value.get(i).keys():
393 | # y.append(value.get(i).get(j))
394 | # else:
395 | # y.append(None)
396 | # if i not in ['js', 'jilin', 'video', 'live']:
397 | # line.add_yaxis(tran(i), y, is_connect_nones=True, is_symbol_show=(time == 'monthly'))
398 | ## line.render("NewPage/无权每月评论.html")
399 | #line.set_global_opts(
400 | # title_opts=options.TitleOpts(title=titleTransform("新浪新闻评论" + str(mode) + str(time) + "评论情感分析"), pos_top='55'))
401 | #return line
402 |
403 |
404 | if __name__ == '__main__':
405 | data = load_files(path="sina/新浪所有新闻-predicted.json")
406 | page = Page()
407 | news = arrangeByTime(data) # 按时间分
408 | news1 = arrangeByChannel(data) # 按频道分
409 | # ---------- 以上是固定代码
410 | page.add(drawCycle(news1))
411 | page.add(drawDailyNewsNum(news, 'daily'))
412 | page.add(drawDailyNewsNum(news, 'monthly'))
413 | #page.add(sina_comment(data, 0, 'daily'))
414 | page.add(sina_comment(data, 1, 'daily'))
415 | #page.add(sina_comment(data, 0, 'monthly'))
416 | page.add(sina_comment(data, 1, 'monthly'))
417 | #page.add(sina_comment(data, 0, 'days'))
418 | page.add(sina_comment(data, 1, 'days'))
419 | page.add(commentChannel(data, 'monthly'))
420 | page.add(commentChannel(data, 'daily'))
421 | temp = bilibili_comment()
422 | for i in temp:
423 | page.add(i)
424 | for i in page:
425 | i.width = "1800px"
426 | temp = sina_all_comment()
427 | for i in temp:
428 | page.add(i)
429 | page.add(drawThreeD(data, 1, 'monthly'))
430 | for i in page:
431 | i.width = "1800px"
432 | page.render()
433 |
434 |
--------------------------------------------------------------------------------
/charts/WordMap.py:
--------------------------------------------------------------------------------
1 | import json
2 | from wordcloud import WordCloud
3 | import matplotlib.pyplot as plt
4 | import cv2
5 |
6 |
7 | def load_files(path):
8 | with open(path, 'r') as f:
9 | return json.load(f)
10 |
11 |
12 | def divide_by_date(news):
13 | news_keywords = []
14 | for new in news:
15 | news_keywords += new['keywords']
16 | if len(news_keywords) == 0:
17 | return "no data"
18 | news_keywords = word_format(news_keywords)
19 | return news_keywords
20 |
21 |
22 | def word_format(words):
23 | res = list(words)
24 | for word in words:
25 | if str(word).isdigit():
26 | res.remove(word)
27 | elif str(word).isascii():
28 | res.remove(word)
29 | return res
30 |
31 |
32 | def draw(keywords, date, mas):
33 | text = " ".join(keywords)
34 | try:
35 | text = text.replace("新浪", "")
36 | text = text.replace("新闻", "")
37 | except:
38 | pass
39 | cloud = WordCloud(
40 | background_color='white',
41 | # 设置背景宽
42 | width=1920,
43 | font_path="HGKT_CNKI.TTF",
44 | # 设置背景高
45 | height=1080,
46 | mode='RGBA',
47 | mask=mas
48 | )
49 | word_cloud = cloud.generate(text)
50 | word_cloud.to_file("picture/" + date + ".png")
51 |
52 |
53 | def show_me(new):
54 | print('----------')
55 | print(new['title'])
56 | print(new['hot_comment_list'])
57 | print(new['keywords'])
58 |
59 |
60 | def arrange(news):
61 | daily = dict()
62 | monthly = dict()
63 | news_list = {"daily": daily, "monthly": monthly}
64 | for year in range(2019, 2021):
65 | for month in range(1, 13):
66 | mon = tostr(year) + "-" + tostr(month)
67 | monLst = []
68 | for day in range(1, 32):
69 | date = tostr(year) + "-" + tostr(month) + "-" + tostr(day)
70 | lst = []
71 | for new in news:
72 | if new["create_date"] == date:
73 | lst.append(new)
74 | monLst.append(new)
75 | if len(lst) != 0:
76 | daily[date] = lst
77 | if len(monLst) != 0:
78 | monthly[mon] = monLst
79 | return news_list
80 |
81 |
82 | def tostr(num):
83 | st = str(num)
84 | if len(st) == 1:
85 | st = "0" + st
86 | return st
87 |
88 |
89 | def numMap(mode):
90 | news = arrange(data)
91 | x_data = news.get(mode).keys()
92 | y_data = []
93 | x = []
94 | for i in x_data:
95 | y_data.append(len(news.get(mode).get(i)))
96 | x.append(i[5:])
97 | plt.figure(figsize=(90, 40))
98 | plt.plot(x, y_data)
99 | plt.savefig("picture/" + mode + ".png")
100 |
101 |
102 | def newsWord(data):
103 | mask = cv2.imread("picture/mask.png")
104 | news = arrange(data).get("daily")
105 | for i in news.keys():
106 | keywords = divide_by_date(news.get(i))
107 | if keywords != "no data":
108 | draw(keywords, i, mask)
109 |
110 |
111 | def parseComment():
112 | str = []
113 | with open("bilibili/bilibili弹幕全集-predicted.csv", 'r', encoding='utf-8') as f:
114 | temp = f.readline()
115 | while temp != "":
116 | temp = temp[:-1]
117 | str.append(temp)
118 | temp = f.readline()
119 | for i in range(0, len(str)):
120 | str[i] = str[i].split(",")
121 | return str
122 |
123 |
124 | def getDailyComment(comments,limit,kind):
125 | daily = dict()
126 | if kind == 'b':
127 | for year in range(2019, 2021):
128 | month = 1
129 | while month <= 12:
130 | day = 1
131 | while day <= 31:
132 | date = tostr(year) + "-" + tostr(month) + "-" + tostr(day)
133 | idx = date
134 | for i in range(0, limit):
135 | lst = []
136 | for comment in comments:
137 | if comment[0] == date:
138 | lst.append(comment)
139 | if len(lst) != 0:
140 | daily[idx] = lst
141 | day += 1
142 | date = tostr(year) + "-" + tostr(month) + "-" + tostr(day)
143 | if day > 31:
144 | month += 1
145 | if month > 12:
146 | break
147 | day -= 31
148 | date = tostr(year) + "-" + tostr(month) + "-" + tostr(day)
149 | print(date)
150 | return daily
151 | for year in range(2019, 2021):
152 | month = 1
153 | while month <= 12:
154 | day = 1
155 | while day <= 31:
156 | date = str(year) + "/" + str(month) + "/" + str(day)
157 | idx = date
158 | for i in range(0, limit):
159 | lst = []
160 | for comment in comments:
161 | if comment[0] == date:
162 | lst.append(comment)
163 | if len(lst) != 0:
164 | daily[idx] = lst
165 | day += 1
166 | date = str(year) + "/" + str(month) + "/" + str(day)
167 | if day > 31:
168 | month += 1
169 | if month > 12:
170 | break
171 | day -= 31
172 | date = str(year) + "/" + str(month) + "/" + str(day)
173 | print(date)
174 | return daily
175 |
176 |
177 | def getValue(lst, mode, kind):
178 | sum = 0.0
179 | times = 0.0
180 | if kind == 'b':
181 | if mode == 1:
182 | mode = 0
183 | tar = 2
184 | else:
185 | tar = 3
186 | if mode == 0:
187 | for i in lst:
188 | if not i[tar].__contains__("."):
189 | print(i[tar])
190 | continue
191 | sum += float(i[tar])
192 | times += 1
193 | else:
194 | for i in lst:
195 | if not i[2].__contains__("."):
196 | print(i[2])
197 | continue
198 | if not i[3].__contains__("."):
199 | print(i[2])
200 | continue
201 | sum += float(i[3])*max(float(i[2]), 1)
202 | times += max(float(i[2]), 1)
203 | return sum/times
204 |
205 |
206 | def parseMood(dic, mode, limit):
207 | x_data = dic.keys()
208 | y_data = []
209 | print(x_data)
210 | x = []
211 | for i in x_data:
212 | x.append(i[5:])
213 | y_data.append(getValue(dic.get(i), mode, 'b'))
214 | plt.figure(figsize=(90, 40))
215 | plt.plot(x, y_data)
216 | plt.savefig("picture/" + str(limit) + "commentMood" + str(mode) + ".png")
217 |
218 | def comment():
219 | lst = parseComment()
220 | day = getDailyComment(lst, 30, 'b')
221 | print(day.get('2020-03-29'))
222 | parseMood(day, 0, 30)
223 |
224 |
225 | if __name__ == '__main__':
226 | data = load_files(path="sina/新浪所有排行新闻.json")
227 | mask = cv2.imread("picture/mask.png")
228 | keywords = []
229 | for new in data:
230 | for i in new['keywords']:
231 | keywords.append(i)
232 | draw(keywords, 'all', mask)
233 |
--------------------------------------------------------------------------------
/normal/article.py:
--------------------------------------------------------------------------------
1 | import json
2 |
3 | import numpy as np
4 | import matplotlib.pyplot as plt
5 | from scipy.optimize import curve_fit
6 | import math
7 | import pandas as pd
8 | import matplotlib.mlab as mlab
9 | from scipy.stats import norm
10 | from scipy.stats import t
11 | import scipy.stats
12 | import demjson
13 |
14 | data=[]
15 | with open('normal.json', 'r') as f:
16 | data = json.load(f)
17 | list=[]
18 | id=[]
19 | data=sorted(data, key = lambda i: int(i['top_num'].replace(",","")),reverse=True)
20 |
21 |
22 | result=[]
23 | for i in range(0,845):
24 | result.append(data[i])
25 | print(data[i]['url'])
26 | print(data[i]['top_num'])
27 | print("\n")
28 | with open('result.json','w') as f:
29 | json.dump(result,f)
30 | print(max)
--------------------------------------------------------------------------------
/normal/curvefit.py:
--------------------------------------------------------------------------------
1 | import json
2 | import numpy as np
3 | import matplotlib.pyplot as plt
4 | from scipy.optimize import curve_fit
5 | import math
6 | from scipy.stats import norm
7 | import scipy.stats
8 |
9 |
10 | def fun(x, a, b, c):
11 | return a*np.exp(-(x-b)**2/(2*c**2))
12 |
13 |
14 | def dic2int(dic):
15 | return int(dic['top_num'].replace(",",""))
16 |
17 |
18 | num = []
19 | with open('num.json', 'r') as f:
20 | num = json.load(f)
21 |
22 |
23 | num=np.array(num)
24 | mu=np.mean(num)
25 | s=np.var(num)
26 | sq=math.sqrt(s)
27 | index=0
28 | for i in range(len(num)):
29 | if(num[i] >mu+3*sq):
30 | index+=1
31 |
32 | num=np.log(num[index:]+4388)
33 | skewp=scipy.stats.skew(num)
34 | kurtosisp=scipy.stats.kurtosis(num,fisher=False)
35 | s1=np.sqrt(6*(len(num)-2)/((len(num)+1)*(len(num)+3)))
36 | s2=np.sqrt(24*(len(num))*(len(num)-2)*(len(num)-3)/((len(num)+1)*(len(num)+1)*(len(num)+3)*(len(num)+5)))
37 | u2=3-6/(len(num)+1)
38 | t1=skewp/s1
39 | t2=(kurtosisp-u2)/s2
40 |
41 | fig=plt.figure()
42 | n,bins,patches=plt.hist(num,bins=30,density=True)
43 | binp=[]
44 | for i in range(0,30):
45 | binp.append((bins[i]+bins[i+1])/2)
46 | popt, _ =curve_fit(fun,binp,n,p0=[1,10.590104,0.492912],maxfev=5000000)
47 | plt.plot(binp,fun(binp,popt[0],popt[1],popt[2]))
48 | plt.hist(num,bins=30,density=True)
49 | plt.show()
--------------------------------------------------------------------------------
/normal/代码分析.md:
--------------------------------------------------------------------------------
1 | ### 代码分析
2 |
3 | #### 代码结构
4 |
5 | 
6 |
7 | #### 代码作用
8 |
9 | data.json:原始新闻数据
10 |
11 | num.json:点击数数据
12 |
13 | result.json:热点新闻数据
14 |
15 | article.py:生成热点新闻数据
16 |
17 | curvefit.py:拟合曲线
18 |
19 |
--------------------------------------------------------------------------------
/normal/代码结构.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Carl-yan-bit/dataScience_term_project/11437f1e016095c728b072babebfdd7a8b7b0130/normal/代码结构.png
--------------------------------------------------------------------------------
/scripts/crawler/bilibili_crawler.py:
--------------------------------------------------------------------------------
1 | import requests
2 | from bs4 import BeautifulSoup
3 | import json
4 | import datetime
5 | import time
6 |
7 |
8 | def getHTMLText(url):
9 | try:
10 | r = requests.get(url, timeout=30)
11 | r.raise_for_status() # 如果状态不是200,引发HTTPError异常
12 | r.encoding = r.apparent_encoding
13 | return r.text
14 | except:
15 | return "产生异常"
16 |
17 |
18 | def getComment_Interface_url(page, oid):
19 | """
20 | 给定页码,视频av号,返回视频评论接口
21 | :param page: 页码
22 | :param oid: av号
23 | :return: 视频评论接口url
24 | """
25 | return "https://api.bilibili.com/x/v2/reply?jsonp=jsonp&pn={}&type=1&oid={}&sort=2".format(page, oid)
26 |
27 |
28 | def getUP_VIDEO_Interface_url(UID, page, ps):
29 | """
30 | 给定UP主UID,页码,每页显示数视频数
31 | :param UID:UP主UID
32 | :param page:页码
33 | :param ps:每页显示视频数
34 | :return:UP主投稿视频接口url
35 | """
36 | return "https://api.bilibili.com/x/space/arc/search?mid={}&pn={}&ps={}".format(UID, page, ps)
37 |
38 |
39 | def tickToDate(time_tick):
40 | """
41 | 将时间戳转换为年月日
42 | :param time_tick: 时间戳字符串
43 | :return: 日期 例:2020-11-06
44 | """
45 | time_array = time.localtime(int(time_tick))
46 | return time.strftime("%Y-%m-%d", time_array)
47 |
48 |
49 | def getVideo_and_Comment(from_date, to_date, uid):
50 | """
51 | 爬取uid对应UP主从from_date到to_date投稿的视频的链接和评论
52 | :param from_date: 起始日期
53 | :param to_date: 终止日期
54 | :param uid: UP主uid
55 | :return: 数据
56 | """
57 | data_sets = [] # 存储数据集
58 | vide_count = 0
59 | hots_comment_count = 0
60 | comment_count = 0
61 | page = 1
62 | while True:
63 | # 循环增加
64 | up_video_list = json.loads(getHTMLText(getUP_VIDEO_Interface_url(uid, page, 100)))["normal"]["list"]["vlist"]
65 | if len(up_video_list) == 0:
66 | print("UP没有视频了!")
67 | break
68 | for video in up_video_list:
69 | pub_time = datetime.datetime.strptime(tickToDate(video['created']), "%Y-%m-%d")
70 | if pub_time < from_date:
71 | print("超过指定日期范围!自动结束!")
72 | return data_sets
73 | if from_date <= pub_time <= to_date: # 在指定日期内
74 | # 爬取评论
75 | comment_url = getComment_Interface_url(1, video['aid'])
76 | try:
77 | t1 = json.loads(getHTMLText(comment_url))
78 | except:
79 | print("错误!")
80 | continue
81 | if 'normal' in t1:
82 | print("有数据")
83 | t = t1['normal']
84 | else:
85 | print("没有数据")
86 | continue
87 | hots_comment_list = t['hots']
88 | if hots_comment_list is None:
89 | hots_comment_list = []
90 | hots_comment_count = hots_comment_count + len(hots_comment_list)
91 | comment_list = t['replies']
92 | if comment_list is None:
93 | comment_list = []
94 | comment_count = comment_count + len(comment_list)
95 | # 清理无用数据项
96 | for i in range(0, len(hots_comment_list)):
97 | t = hots_comment_list[i]
98 | hots_comment_list[i] = {'rcount': t['rcount'], 'ctime': t['ctime'], 'like': t['like'], 'message':
99 | t['content']['message']}
100 | for i in range(0, len(comment_list)):
101 | t = comment_list[i]
102 | comment_list[i] = {'rcount': t['rcount'], 'ctime': t['ctime'], 'like': t['like'], 'message':
103 | t['content']['message']}
104 | video['hots_comment_list'] = hots_comment_list
105 | video['comment_list'] = comment_list
106 |
107 | # 将评论加入video
108 | video = {'comment': video['comment'], 'play': video['play'], 'description': video['description'],
109 | 'title': video['title'], 'author': video['author'], 'created': tickToDate(video['created']),
110 | 'aid': video['aid'], 'bvid': video['bvid'], 'hots_comment_list': video['hots_comment_list'],
111 | 'comment_list': video['comment_list']}
112 | data_sets.append(video)
113 | vide_count = vide_count + 1
114 | print("视频数:{}, 热门评论数:{}, 评论数:{}, 日期:{}, 视频名称:{}".format(vide_count, hots_comment_count, comment_count,
115 | pub_time, video['title']))
116 | page = page + 1
117 | return data_sets
118 |
119 |
120 | def getVIDEO_CID(aid):
121 | try:
122 | url = "https://www.bilibili.com/widget/getPageList?aid={}".format(aid)
123 | res = json.loads(getHTMLText(url))
124 | return res[0]['cid']
125 | except:
126 | print('返回cid失败!')
127 | return "error"
128 |
129 |
130 | def static_count(uid_map):
131 | """
132 | 统计爬取数据
133 | :param uid_map: 传入uid_map
134 | :return:
135 | """
136 | total_video_count = 0
137 | total_hot_comment_count = 0
138 | total_comment_count = 0
139 |
140 | for key in uid_map:
141 | with open('../../dataSets/bilibili/{}.json'.format(key), 'r') as f:
142 | data_sets = json.load(f)
143 | video_count = len(data_sets)
144 | hot_comment_count = 0
145 | comment_count = 0
146 | for item in data_sets:
147 | hot_comment_count = hot_comment_count + len(item['hots_comment_list'])
148 | comment_count = comment_count + len(item['comment_list'])
149 | print("{}: 视频数:{}, 热门评论数:{}, 评论数: {}".format(key, video_count, hot_comment_count, comment_count))
150 | total_video_count = total_video_count + video_count
151 | total_hot_comment_count = total_hot_comment_count + hot_comment_count
152 | total_comment_count = total_comment_count + comment_count
153 | print("全部:视频数:{},热门评论数:{}, 评论数: {}".format(total_video_count, total_hot_comment_count, total_comment_count))
154 |
155 |
156 | def getBullet_Comment(cid):
157 | """
158 | 给定cid,返回弹幕的.xml文件
159 | :param cid: 视频cid
160 | :return: .xml文件
161 | """
162 | res = getHTMLText("http://comment.bilibili.com/{}.xml".format(cid))
163 | return res
164 |
165 |
166 | def crawler(uid_map):
167 | total_bullet_count = 0
168 | for key in uid_map:
169 | bullet_count = 0
170 | print("正在获取{}-账号的弹幕".format(key))
171 | with open('../../dataSets/bilibili/{}.json'.format(key), 'r') as f:
172 | data = json.load(f)
173 | for i in range(0, len(data)):
174 | time.sleep(2)
175 | item = data[i]
176 | print("正在获取{}的弹幕 {}".format(item['title'], item['created']))
177 | cid = getVIDEO_CID(item['aid'])
178 | if cid == "error":
179 | continue
180 | raw_bullet_comment = getBullet_Comment(cid)
181 | soup = BeautifulSoup(raw_bullet_comment, 'xml').find_all('d')
182 | bullet_comments = []
183 | for c in soup:
184 | bullet_comments.append(c.get_text())
185 | item['bullet_comments'] = bullet_comments
186 | bullet_count = bullet_count + len(bullet_comments)
187 | total_bullet_count = total_bullet_count + len(bullet_comments)
188 | print("搜集弹幕{}, 累计{}".format(len(bullet_comments), total_bullet_count))
189 | data[i] = item
190 |
191 | print("{}共搜集弹幕{}, 累计{}".format(key, bullet_count, total_bullet_count))
192 | with open('../../dataSets/bilibili/{}.json'.format(key), 'w') as f:
193 | json.dump(data, f)
194 | print("弹幕总计:{}".format(total_bullet_count))
195 |
196 |
197 | if __name__ == "__main__":
198 | uid_map = {"共青团中央": "20165629", "央视新闻": "456664753", "小央视频": "222103174", "中国日报": "21778636", "新华社":
199 | "473837611", "人民网": "33775467", "央视频": "433587902", "光明日报": "404414222", "央视网快看": "451320374",
200 | "观察者网": "10330740", "观视频工作室": "54992199", "环球时报": "10303206", "人民视频": "386265385",
201 | "广东共青团": "330383888", "浙江共青团": "384298638", "河南共青团": "323194278",
202 | "安徽共青团": "268810504", "湖南共青团": "43563506", "福建共青团": "28897026", "重庆共青团": "212375551",
203 | "四川共青团": "483940995", "贵州共青团": "452215100", "江西共青团": "109586062", "江苏共青团": "543191732",
204 | "云南共青团": "285216473"} # UP主UID
205 |
206 | # from_date = datetime.datetime.strptime("2019-12-08", "%Y-%m-%d")
207 | # to_date = datetime.datetime.strptime("2020-6-20", "%Y-%m-%d")
208 |
209 | # for key in uid_map:
210 | # # print("正在搜集{}视频".format(key))
211 | # # data_sets = getVideo_and_Comment(from_date, to_date, uid_map[key])
212 | # with open('../../dataSets/bilibili/{}.json'.format(key), 'r') as f:
213 | # normal = json.load(f)
214 | #
215 | #
216 | # with open('../../dataSets/bilibili/{}.json'.format(key), 'w') as f:
217 | # json.dump(data_sets, f)
218 | # print("{}视频搜集完成!".format(key))
219 |
220 | # print(getVIDEO_CID("498617621"))
221 | # static_count(uid_map)
222 |
--------------------------------------------------------------------------------
/scripts/crawler/sina_crawler.py:
--------------------------------------------------------------------------------
1 | import requests
2 | from bs4 import BeautifulSoup
3 | import json
4 | import datetime
5 | import re
6 | import jieba
7 | from jieba import analyse
8 | import time
9 |
10 |
11 | def getTOP_COMMENT_NEWS_URL(year, month, day, count):
12 | """
13 | 获取新浪新闻某天评论数前count个的新闻的js的url
14 | :param year:年份
15 | :param month:月份
16 | :param day:日期
17 | :param count:数量
18 | :return:新浪新闻某天评论数前count个的新闻的js的url
19 | """
20 | return "http://top.news.sina.com.cn/ws/GetTopDataList.php?top_type=day&top_cat=qbpdpl&top_time={}{}{}&" \
21 | "top_show_num={}&top_order=DESC&js".format(year, month, day, count)
22 |
23 |
24 | def getTOP_CLICK_NEWS_URL(year, month, day, count):
25 | """
26 | 获取新浪新闻某天点击量前count个的新闻的js的url
27 | :param year:年份
28 | :param month:月份
29 | :param day:日期
30 | :param count:数量
31 | :return:新浪新闻某天点击量前count个的新闻的js的url
32 | """
33 | return "http://top.news.sina.com.cn/ws/GetTopDataList.php?top_type=day&top_cat=www_www_all_suda_suda&top_time=" \
34 | "{}{}{}&top_show_num={}&top_order=DESC&js".format(year, month, day, count)
35 |
36 |
37 | def getHTMLText(url):
38 | try:
39 | r = requests.get(url, timeout=30)
40 | r.raise_for_status() # 如果状态不是200,引发HTTPError异常
41 | r.encoding = r.apparent_encoding
42 | return r.text
43 | except:
44 | return "产生异常"
45 |
46 |
47 | def getTOP_COMMENT_NEWS(from_date, to_date, count):
48 | """
49 | 获取时间一定时间跨度的每日评论数前count个新闻
50 | :param from_date: 开始时间
51 | :param to_date: 结束时间
52 | :param count:
53 | :return: 返回news列表
54 | """
55 | day_counts = (to_date - from_date).days # 跨越天数
56 | now_date = from_date
57 | one_day = datetime.timedelta(days=1)
58 | news = []
59 | for i in range(0, day_counts + 1):
60 | year = now_date.strftime('%Y-%m-%d')[0:4]
61 | month = now_date.strftime('%Y-%m-%d')[5:7]
62 | day = now_date.strftime('%Y-%m-%d')[8:]
63 | url = getTOP_COMMENT_NEWS_URL(year, month, day, str(count))
64 | text = json.loads(getHTMLText(url)[11:].replace(';', ''))
65 |
66 | for item in text['normal']:
67 | news.append(item)
68 | now_date = now_date + one_day
69 | return news
70 |
71 |
72 | def getTOP_CLICK_NEWS(from_date, to_date, count):
73 | """
74 | 获取时间一定时间跨度的每日点击量前count个新闻
75 | :param from_date: 开始时间,必须为datetime.datetime对象
76 | :param to_date: 结束时间,必须为datetime.datetime对象
77 | :param count: 每日搜集新闻数量
78 | :return: 返回news的json文件格式的字符串
79 | """
80 | day_counts = (to_date - from_date).days # 跨越天数
81 | now_date = from_date
82 | one_day = datetime.timedelta(days=1)
83 | news = []
84 | for i in range(0, day_counts + 1):
85 | year = now_date.strftime('%Y-%m-%d')[0:4]
86 | month = now_date.strftime('%Y-%m-%d')[5:7]
87 | day = now_date.strftime('%Y-%m-%d')[8:]
88 | url = getTOP_CLICK_NEWS_URL(year, month, day, str(count))
89 | text = json.loads(getHTMLText(url)[11:].replace(';', ''))
90 |
91 | for item in text['normal']:
92 | news.append(item)
93 | now_date = now_date + one_day
94 | return news
95 |
96 |
97 | def getHOT_COMMENT(channel, news_id):
98 | """
99 | 根据news_id返回热门评论
100 | :param channel: 频道
101 | :param news_id: 新闻id
102 | :return: 返回热闹评论list
103 | """
104 | url = 'http://comment.sina.com.cn/page/info?version=1&format=json&channel={}&newsid={}&group=0&compress=0&ie=gbk&' \
105 | 'oe=gbk&page=1&page_size=100&t_size=3&h_size=100&thread=1&uid=unlogin_user'.format(channel, news_id)
106 | t = requests.get(url)
107 | comment = json.loads(t.text)['result']
108 | if 'hot_list' in comment:
109 | cmnt = []
110 | t = {}
111 | for c in comment['hot_list']:
112 | t['agree'] = c['agree']
113 | t['area'] = c['area']
114 | t['channel'] = c['channel']
115 | t['content'] = c['content']
116 | t['nick'] = c['nick']
117 | t['newsid'] = c['newsid']
118 | cmnt.append(t)
119 | return cmnt
120 | return []
121 |
122 |
123 | def get_COMMENT(channel, news_id):
124 | # { "nick": "\u7528\u62377252512274", "newsid": "comos-ihnzhfz9458815"
125 | """
126 | 根据news_id返回评论
127 | :param news_id: 新闻id
128 | :return: 返回热闹评论list
129 | """
130 | url = 'http://comment.sina.com.cn/page/info?version=1&format=json&channel={}&newsid={}&group=0&compress=0&ie=gbk&' \
131 | 'oe=gbk&page=1&page_size=100&t_size=3&h_size=100&thread=1&uid=unlogin_user'.format(channel, news_id)
132 | t = requests.get(url)
133 | comment = json.loads(t.text)['result']
134 | if 'cmntlist' in comment:
135 | cmnt = []
136 | t = {}
137 | for c in comment['cmntlist']:
138 | t['agree'] = c['agree']
139 | t['area'] = c['area']
140 | t['channel'] = c['channel']
141 | t['content'] = c['content']
142 | t['nick'] = c['nick']
143 | t['newsid'] = c['newsid']
144 | cmnt.append(t)
145 | return cmnt
146 | return []
147 |
148 |
149 | def get_Article(url):
150 | h = getHTMLText(url)
151 | txt = ""
152 | try:
153 | h1 = BeautifulSoup(h, 'html.parser')
154 | txt = h1.find('div', {'id': re.compile('.*article.*')}).get_text().replace("\n", "")
155 | except:
156 | print("错误!")
157 | return txt
158 |
159 |
160 | if __name__ == "__main__":
161 | channels = ['gn', 'gj', 'live', 'cj', 'yl', 'mp', 'sh', 'ty', 'kj', 'survey']
162 | # hot_comment_count = 158966
163 | # comment_count = 627770
164 | # news_count = 18500
165 | # for item in news[18500:]:
166 | # news_count = news_count + 1
167 | # url = item['url']
168 | #
169 | # left, right = re.search('/(doc|zl)-i.*', url).span()
170 | # news_id = "comos-" + url[left + 6:right-6]
171 | # hot_comment_list = []
172 | # comment_list = []
173 | # for channel in channels:
174 | # hot_comment_list = getHOT_COMMENT(channel, news_id)
175 | # if len(hot_comment_list) != 0:
176 | # break
177 | # hot_comment_count = hot_comment_count + len(hot_comment_list)
178 | # for k in range(0, len(hot_comment_list)):
179 | # hot_comment = hot_comment_list[k]
180 | # hot_comment_list[k] = {'agree': hot_comment['agree'], 'area': hot_comment['area'], 'channel': hot_comment['channel'],
181 | # 'content': hot_comment['content'], 'nick': hot_comment['nick'], 'newsid': hot_comment['newsid']}
182 | # item['hot_comment_list'] = hot_comment_list
183 | #
184 | # for channel in channels:
185 | # comment_list = get_COMMENT(channel, news_id)
186 | # if len(comment_list) != 0:
187 | # break
188 | # comment_count = comment_count + len(comment_list)
189 | # for k in range(0, len(comment_list)):
190 | # comment = comment_list[k]
191 | # comment_list[k] = {'agree': comment['agree'], 'area': comment['area'], 'channel': comment['channel'],
192 | # 'content': comment['content'], 'nick': comment['nick'], 'newsid': comment['newsid']}
193 | # item['comment_list'] = comment_list
194 | #
195 | # print("完成{}/19533, 热门评论{}, 其他评论{}".format(news_count, hot_comment_count, comment_count))
196 | # # 每完成250存储一次
197 | # if news_count % 250 == 0:
198 | # print("存储成功!")
199 | # with open('../../dataSets/sina/sina_top_click_news.json', 'w') as f:
200 | # json.dump(news, f)
201 |
202 | # with open('../../dataSets/sina/sina_top_click_news.json', 'w') as f:
203 | # json.dump(news, f)
--------------------------------------------------------------------------------
/scripts/crawler/test.py:
--------------------------------------------------------------------------------
1 | import requests
2 | from bs4 import BeautifulSoup
3 | import json
4 | import datetime
5 |
6 |
7 | def getHTMLText(url):
8 | try:
9 | r = requests.get(url, timeout=30)
10 | r.raise_for_status() # 如果状态不是200,引发HTTPError异常
11 | r.encoding = r.apparent_encoding
12 | return r.text
13 | except:
14 | return "产生异常"
15 |
16 |
17 | if __name__ == "__main__":
18 | with open('../../dataSets/sina/新浪所有新闻.json', 'r') as f:
19 | data = json.load(f)
20 | comment_count = 0
21 | txt = "time,content,agree,sentiment\n"
22 | for item in data:
23 |
24 | for i in item['hot_comment_list']:
25 | txt = txt + item['create_date'] + ',' + i['content'].replace(',', ',').replace('\n', ' ') + ',' + i['agree']\
26 | + ',' + 'NaN\n'
27 | comment_count = comment_count + 1
28 | print(comment_count)
29 |
30 | for i in item['comment_list']:
31 | txt = txt + item['create_date'] + ',' + i['content'].replace(',', ',').replace('\n', ' ') + ',' + i['agree'] \
32 | + ',' + 'NaN\n'
33 | comment_count = comment_count + 1
34 | print(comment_count)
35 |
36 | print("评论数:{}".format(comment_count))
37 | with open('../../dataSets/sina/样本/新浪所有新闻评论全集.csv', 'w', encoding='utf-8') as f:
38 | f.write(txt)
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/scripts/data_process/charts.py:
--------------------------------------------------------------------------------
1 | import json
2 |
3 |
4 | if __name__ == "__main__":
5 | with open('../../dataSets/sina/新浪所有新闻-predicted.json', 'r') as f:
6 | sina_news = json.load(f)
7 |
8 | date = []
9 | keywords = {}
10 | for news in sina_news:
11 | if news['create_date'] not in date:
12 | date.append(news['create_date'])
13 | for keyword in news['keywords']:
14 | if keyword not in keywords:
15 | keywords[keyword] = 1
16 | else:
17 | keywords[keyword] += 1
18 |
19 | csv_file = "关键词,"
20 | for d in date:
21 | csv_file += d + ','
22 | csv_file = csv_file[0: -1]
23 | csv_file += '\n'
24 | count = 0
25 | filter_keywords = {}
26 | for i in keywords:
27 | if keywords[i] >= 100 and not i.isdigit() and not i == "责任编辑" and not i == 'SINA' or i == '2020':
28 | # count += 1
29 | print("{}:{}".format(i, keywords[i]))
30 | filter_keywords[i] = {}
31 |
32 | # print("统计{}".format(count))
33 | # print(len(filter_keywords))
34 |
35 | for news in sina_news:
36 | for k in filter_keywords:
37 | if news['create_date'] not in filter_keywords[k]:
38 | filter_keywords[k][news['create_date']] = 0
39 |
40 | for keyword in news['keywords']:
41 | if keyword in filter_keywords:
42 | filter_keywords[keyword][news['create_date']] += 1
43 |
44 | for word in filter_keywords:
45 | # print(word)
46 | csv_file += word + ','
47 | for date in filter_keywords[word]:
48 | # print("{}:{}".format(date, filter_keywords[word][date]))
49 | total_count = 0
50 | for d in filter_keywords[word]:
51 | if d != date:
52 | total_count += filter_keywords[word][d]
53 | else:
54 | total_count += filter_keywords[word][d]
55 | break
56 | csv_file += str(total_count) + ','
57 | csv_file = csv_file[0: -1]
58 | csv_file += '\n'
59 |
60 | with open('../../dataSets/sina/关键词累计统计.csv', 'w') as f:
61 | f.write(csv_file)
--------------------------------------------------------------------------------
/scripts/data_process/data_filter.py:
--------------------------------------------------------------------------------
1 | import jieba
2 | import json
3 | from jieba import analyse
4 | from wordcloud import WordCloud
5 | import pandas as pd
6 | from bs4 import BeautifulSoup
7 | import requests
8 |
9 |
10 | def getHTMLText(url):
11 | try:
12 | r = requests.get(url, timeout=30)
13 | r.raise_for_status() # 如果状态不是200,引发HTTPError异常
14 | r.encoding = r.apparent_encoding
15 | return r.text
16 | except:
17 | return "产生异常"
18 |
19 |
20 | def sina_filter(keywords):
21 | """
22 | 根据关键词过滤
23 | :param keywords:关键词
24 | :return:
25 | """
26 | with open('../../dataSets/sina/sina_top_click_news.json', 'r') as f:
27 | sina_top_click_news = json.load(f)
28 | with open('../../dataSets/sina/sina_top_comment_news.json', 'r') as f:
29 | sina_top_comment_news = json.load(f)
30 |
31 | filter_sina_top_click_news = []
32 | filter_click_count = 0
33 | filter_sina_top_comment_news = []
34 | filter_comment_count = 0
35 |
36 | # 点击量新闻过滤
37 | for item in sina_top_click_news:
38 | words = jieba.lcut(item['title'])
39 | isMatch = False
40 | for word in words:
41 | if word in keywords:
42 | isMatch = True
43 | break
44 | if isMatch:
45 | filter_sina_top_click_news.append(item)
46 | filter_click_count = filter_click_count + 1
47 | continue
48 | for key in item['keywords']:
49 | if key in keywords:
50 | isMatch = True
51 | break
52 | if isMatch:
53 | filter_sina_top_click_news.append(item)
54 | filter_click_count = filter_click_count + 1
55 | # 评论量新闻过滤
56 | for item in sina_top_comment_news:
57 | words = jieba.lcut(item['title'])
58 | isMatch = False
59 | for word in words:
60 | if word in keywords:
61 | isMatch = True
62 | break
63 | if isMatch:
64 | filter_sina_top_comment_news.append(item)
65 | filter_comment_count = filter_comment_count + 1
66 | continue
67 | for key in item['keywords']:
68 | if key in keywords:
69 | isMatch = True
70 | break
71 | if isMatch:
72 | filter_sina_top_comment_news.append(item)
73 | filter_comment_count = filter_comment_count + 1
74 |
75 | print("新浪点击量排行新闻:{}".format(filter_click_count))
76 | print("新浪评论量排行新闻:{}".format(filter_comment_count))
77 | with open('../../dataSets/sina/新浪点击量排行新闻.json', 'w') as f:
78 | json.dump(filter_sina_top_click_news, f)
79 | with open('../../dataSets/sina/新浪评论量排行新闻.json', 'w') as f:
80 | json.dump(filter_sina_top_comment_news, f)
81 |
82 |
83 | def bilibili_filter(base_keywords):
84 |
85 | uid_map = {"共青团中央": "20165629", "央视新闻": "456664753", "小央视频": "222103174", "中国日报": "21778636", "新华社":
86 | "473837611","人民网": "33775467", "央视频": "433587902", "光明日报": "404414222", "央视网快看": "451320374",
87 | "观察者网": "10330740", "观视频工作室": "54992199", "环球时报": "10303206", "人民视频": "386265385",
88 | "广东共青团": "330383888", "浙江共青团": "384298638", "河南共青团": "323194278",
89 | "安徽共青团": "268810504", "湖南共青团": "43563506", "福建共青团": "28897026", "重庆共青团": "212375551",
90 | "四川共青团": "483940995", "贵州共青团": "452215100", "江西共青团": "109586062", "江苏共青团": "543191732",
91 | "云南共青团": "285216473"}
92 | for key in uid_map:
93 | print("开始筛选{}".format(key))
94 |
95 | with open("../../dataSets/bilibili/{}.json".format(key), 'r') as f:
96 | data = json.load(f)
97 | new_data = []
98 | pass_num = 0
99 | for item in data:
100 | bv = item['bvid']
101 | html = getHTMLText("https://www.bilibili.com/video/{}?".format(bv))
102 |
103 | soup = BeautifulSoup(html, 'html.parser')
104 | raw_keywords = soup.find('meta', {'itemprop': 'keywords', 'name': 'keywords'})
105 | keywords = []
106 | if raw_keywords != None:
107 | keywords = raw_keywords.get_attribute_list('content')
108 |
109 | item['keywords'] = keywords
110 | print('{}: 时间:{}, title: {}, keywords: {}'.format(key, item['created'], item['title'], item['keywords']))
111 | fit = False
112 | for word in jieba.lcut(item['title']):
113 | if word in base_keywords:
114 | fit = True
115 | break
116 | if fit:
117 | new_data.append(item)
118 | pass_num = pass_num + 1
119 | print("符合!通过!{}".format(pass_num))
120 | continue
121 |
122 | for word in item['keywords']:
123 | for w in jieba.lcut(word):
124 | if w in base_keywords:
125 | fit = True
126 | break
127 | if fit:
128 | break
129 |
130 | if fit:
131 | new_data.append(item)
132 | pass_num = pass_num + 1
133 | print("符合!通过!{}".format(pass_num))
134 | continue
135 |
136 | for word in jieba.lcut(item['description']):
137 | if word in base_keywords:
138 | fit = True
139 | break
140 | if fit:
141 | new_data.append(item)
142 | pass_num = pass_num + 1
143 | print("符合!通过!{}".format(pass_num))
144 | continue
145 |
146 | with open("../../dataSets/bilibili/{}.json".format(key), 'w') as f:
147 | json.dump(new_data, f)
148 | print("{}保存成功!".format(key))
149 |
150 |
151 | def sina_language_corpus():
152 | # 建立新浪语料库
153 | with open('../../dataSets/sina/sina_top_click_news.json', 'r', encoding='utf-8') as f:
154 | data = json.load(f)
155 | txt = "content\n"
156 | count = 0
157 | for news in data:
158 | for comment in news['hot_comment_list']:
159 | txt = txt + comment['content'].replace('\n', ' ').replace(',', ',') + '\n'
160 | count += 1
161 | for comment in news['comment_list']:
162 | txt = txt + comment['content'].replace('\n', ' ').replace(',', ',') + '\n'
163 | count += 1
164 | print(count)
165 | with open('../../dataSets/sina/sina_top_comment_news.json', 'r', encoding='utf-8') as f:
166 | data = json.load(f)
167 |
168 | for news in data:
169 | for comment in news['hot_comment_list']:
170 | txt = txt + comment['content'].replace('\n', ' ').replace(',', ',') + '\n'
171 | count += 1
172 | for comment in news['comment_list']:
173 | txt = txt + comment['content'].replace('\n', ' ').replace(',', ',') + '\n'
174 | count += 1
175 | print(count)
176 | with open('../../dataSets/sina/新浪语料库.csv', 'w', encoding='utf-8') as f:
177 | f.write(txt)
178 |
179 |
180 | if __name__ == "__main__":
181 | # 用于过滤的关键词
182 | keywords = ['疫情', '防控', '复工', '复产', '肺炎', '确诊', '病例', '新冠',
183 | '防控', '病毒', '抗疫', '防疫', '疫苗', '抗体', '冠状', '口罩'
184 | '世卫', '冠状病毒', '新冠肺炎', '钟南山']
185 | # sina_filter(keywords)
186 | bilibili_filter(keywords)
187 | jieba.analyse.extract_tags()
188 |
189 |
--------------------------------------------------------------------------------
/scripts/data_process/nlp.py:
--------------------------------------------------------------------------------
1 | from snownlp import SnowNLP
2 | import snownlp
3 | import json
4 | import requests
5 | import jieba
6 | import pandas as pd
7 | import numpy as np
8 | from gensim.models.word2vec import Word2Vec
9 | from sklearn.externals import joblib
10 | from sklearn.model_selection import cross_val_score
11 | from sklearn.svm import SVC
12 | from sklearn.svm import LinearSVC
13 | from sklearn.model_selection import train_test_split
14 | import gensim
15 | from sklearn.model_selection import cross_val_score
16 | from sklearn import neighbors
17 | from sklearn.naive_bayes import GaussianNB
18 | from sklearn.neural_network import MLPClassifier
19 | from sklearn import metrics
20 | from sklearn import tree
21 | from sklearn.linear_model import LogisticRegression
22 | from sklearn.linear_model import Perceptron #感知机算法
23 | from sklearn.linear_model import SGDClassifier #梯度下降分类
24 | from sklearn.ensemble import RandomForestClassifier #随机森林
25 | from keras.models import Sequential
26 | from keras.layers import Dense
27 | import keras
28 | import csv
29 | import pickle
30 | import jieba.analyse
31 | from sklearn.neighbors import KNeighborsClassifier
32 |
33 |
34 | def Hanlp(url, token, txt):
35 | # 调用Hanlp进行情感预测
36 | headers = {'token': token}
37 | data = {'text': txt}
38 | response = requests.post(url, data=data, headers=headers)
39 | s = response.content.decode('utf-8')
40 | print(s)
41 | if "情感极性是 【正面】" in s:
42 | print("正面")
43 | return 1
44 | else:
45 | print('负面')
46 | return 0
47 |
48 |
49 | def train_word2vec_model(dimension):
50 | '''
51 | 训练word2vec模型
52 | :param dimension:维度
53 | :return:
54 | '''
55 | with open('../../dataSets/sina/新浪语料库.csv', 'r', encoding='utf-8') as f:
56 | total = pd.read_csv(f, quoting=csv.QUOTE_NONE)
57 | with open('../../dataSets/bilibili/样本/bilibili弹幕全集.csv', 'r', encoding='utf-8') as f:
58 | bilibili = pd.read_csv(f)
59 | total['content'] = total['content'].apply(lambda x: jieba.lcut(str(x)))
60 | bilibili['content'] = bilibili['content'].apply(lambda x: jieba.lcut(str(x)))
61 | total = np.concatenate((total['content'], bilibili['content']))
62 | # 初始化高维空间
63 | w2v = Word2Vec(size=dimension)
64 | w2v.build_vocab(total)
65 | # 训练模型
66 | w2v.train(total, total_examples=w2v.corpus_count, epochs=w2v.iter)
67 | # 保存模型
68 | w2v.save('../../model/nlp/w2v_{}维_560万语料库.w2v'.format(dimension))
69 |
70 |
71 | def train_nlp_model(train_model, dimension, word2vec_model):
72 | """
73 | 传入要训练的模型,设定训练集向量化维度并开始训练
74 | :param train_model: 要训练的模型
75 | :param dimension: 训练集向量化的维度
76 | :return:
77 | """
78 |
79 | def total_vec(words, dim):
80 | vec = np.zeros(dim).reshape((1, dim))
81 | for word in words:
82 | try:
83 | vec += w2v.wv[word].reshape((1, dim))
84 | except KeyError:
85 | continue
86 | return vec
87 |
88 | with open('../../dataSets/sina/样本/新浪所有新闻评论训练集-正面.CSV', 'r') as f:
89 | pos = pd.read_csv(f)
90 |
91 | with open('../../dataSets/sina/样本/新浪所有新闻评论训练集-负面.CSV', 'r') as f:
92 | neg = pd.read_csv(f)
93 |
94 | # with open('../../dataSets/bilibili/样本/bilibili弹幕训练集-正面.csv', 'r') as f:
95 | # pos = pd.read_csv(f)
96 | #
97 | # with open('../../dataSets/bilibili/样本/bilibili弹幕训练集-负面.csv', 'r') as f:
98 | # neg = pd.read_csv(f)
99 |
100 | # 分词
101 | neg['content'] = neg['content'].apply(lambda x: jieba.lcut(x))
102 | pos['content'] = pos['content'].apply(lambda x: jieba.lcut(x))
103 |
104 | # 合并训练集
105 | x = np.concatenate((pos['content'], neg['content']))
106 | # 标签集
107 | y = np.concatenate((np.ones(len(pos)), np.zeros(len(neg))))
108 |
109 | w2v = word2vec_model
110 |
111 | # 获得向量训练集
112 | all_vec = np.concatenate([total_vec(words, dimension) for words in x])
113 | train_vec, test_vec, train_y, test_y = train_test_split(all_vec, y, test_size=0.1)
114 |
115 | # 初始模型并训练
116 | print("开始训练模型")
117 | model = train_model.fit(train_vec, train_y)
118 | clf = model
119 |
120 | # 测试
121 | # scores = cross_val_score(clf, all_vec, y, cv=5)
122 | # print(scores)
123 | test_predict = model.predict(test_vec)
124 | train_predict = model.predict(train_vec)
125 |
126 | print("测试集报告:")
127 | print(metrics.classification_report(test_y, test_predict, digits=3))
128 | print("训练集报告:")
129 | print(metrics.classification_report(train_y, train_predict, digits=3))
130 | # 保存模型
131 | # joblib.dump(model, '../../model/nlp/bilibili_nlp_model.joblib')
132 |
133 |
134 | def test_nlp_model(model, dimension, word2vec_model):
135 | w2v = word2vec_model
136 |
137 | def total_vec(words, dim):
138 | vec = np.zeros(dim).reshape((1, dim))
139 | for word in words:
140 | try:
141 | vec += w2v.wv[word].reshape((1, dim))
142 | except KeyError:
143 | continue
144 | return vec
145 | with open('../../dataSets/bilibili/样本/bilibili弹幕训练集-labeled.csv', 'r', errors='ignore') as f:
146 | test_data = pd.read_csv(f)
147 | test_data['content'] = test_data['content'].apply(lambda x: jieba.lcut(x))
148 | x = test_data['content']
149 | y = test_data['sentiment']
150 |
151 | x_vec = np.concatenate([total_vec(words, dimension) for words in x])
152 | test_predict = model.predict(x_vec)
153 | print(metrics.classification_report(y, test_predict, digits=3))
154 |
155 |
156 | def toVec(words, dim, word2vec):
157 | # 将字符串转化为高维向量
158 | words = jieba.lcut(words)
159 | vec = np.zeros(dim).reshape((1, dim))
160 | for word in words:
161 | try:
162 | vec += word2vec.wv[word].reshape((1, dim))
163 | except KeyError:
164 | continue
165 | return vec
166 |
167 |
168 | def model_predict(words, dim, model, word2vec):
169 | # 利用SVM模型判断情感
170 | return model.predict(toVec(words, dim, word2vec))
171 |
172 |
173 | def predict():
174 | # 使用训练好的模型预测数据
175 | w2v = Word2Vec.load('../../model/nlp/w2v_300维_560万语料库.w2v')
176 | model = joblib.load('../../model/nlp/sina_nlp_model.joblib')
177 |
178 | with open('../../dataSets/sina/新浪所有新闻.json', 'r', encoding='utf-8') as f:
179 | sina_news = json.load(f)
180 |
181 | new_sina_news = []
182 | count = 0
183 |
184 | for news in sina_news:
185 | hot_comment_list = []
186 | comment_list = []
187 | for comment in news['hot_comment_list']:
188 | count += 1
189 | content = comment['content']
190 | try:
191 | s = model_predict(str(content), 300, model, w2v)[0]
192 | comment['sentiment'] = s
193 | hot_comment_list.append(comment)
194 | print(count)
195 | except:
196 | print("错误!")
197 | s = 'NaN'
198 | comment['sentiment'] = s
199 | hot_comment_list.append(comment)
200 | continue
201 |
202 | for comment in news['comment_list']:
203 | count += 1
204 | content = comment['content']
205 | try:
206 | s = model_predict(str(content), 300, model, w2v)[0]
207 | comment['sentiment'] = s
208 | comment_list.append(comment)
209 | print(count)
210 | except:
211 | print("错误!")
212 | s = 'NaN'
213 | comment['sentiment'] = s
214 | comment_list.append(comment)
215 | continue
216 | news['hot_comment_list'] = hot_comment_list
217 | news['comment_list'] = comment_list
218 | new_sina_news.append(news)
219 |
220 | with open('../../dataSets/sina/新浪所有新闻-predicted.json', 'w', encoding='utf-8') as f:
221 | json.dump(new_sina_news, f)
222 |
223 |
224 | if __name__ == "__main__":
225 | # string = "中国必胜!"
226 | # result = SVM_predict(string, 300)
227 | # print(result)
228 | # 随机森林
229 | # train_model = RandomForestClassifier(max_depth=12)
230 | # 线性支持向量机
231 | # train_model = LinearSVC()
232 | # train_model = SVC()
233 | # 决策树
234 | # train_model = tree.DecisionTreeClassifier(max_depth=8)
235 | # knn
236 | # train_model = KNeighborsClassifier()
237 | # 贝叶斯
238 | # train_model = GaussianNB()
239 | # 感知机
240 | # train_model = Perceptron()
241 | # 神经网络
242 | train_model = MLPClassifier(hidden_layer_sizes=(50, ), activation='logistic', solver='adam', max_iter=4000)
243 | # 逻辑回归
244 | # train_model = LogisticRegression()
245 | train_nlp_model(train_model=train_model, dimension=300, word2vec_model=Word2Vec.load('../../model/nlp/w2v_300维_560万语料库.w2v'))
246 |
247 | # model = Word2Vec.load('../../model/nlp/w2v_300.w2v')
248 | # print(model.most_similar('', topn=20))
249 | # train_word2vec_model(200)
250 | # predict()
251 |
252 |
253 |
254 |
--------------------------------------------------------------------------------
/scripts/data_process/nlp_test.py:
--------------------------------------------------------------------------------
1 | from snownlp import SnowNLP
2 | import snownlp
3 | import json
4 | import requests
5 | import jieba
6 | import pandas as pd
7 |
8 |
9 | def SNOW_NLP_ORIGIN_TEST(path):
10 | # 调用SNOW_NLP进行情感预测
11 | total_num = 0
12 | correct_num = 0
13 | with open(path, 'r') as f:
14 | data = pd.read_csv(f)
15 |
16 | for index, row in data.iterrows():
17 | nlp = SnowNLP(row['content'])
18 |
19 | if abs(float(nlp.sentiments) - float(row['sentiment'])) <= 0.5:
20 | correct_num = correct_num + 1
21 | total_num = total_num + 1
22 | print("{}/{}".format(correct_num, total_num))
23 |
24 | print("训练集大小:{}, 正确率:{}".format(total_num, correct_num / total_num))
25 |
26 |
27 | def Hanlp_ORIGIN_TEST(path):
28 | # 调用Hanlp进行预测
29 | total_num = 0
30 | correct_num = 0
31 | with open(path, 'r') as f:
32 | data = pd.read_csv(f)
33 |
34 | for index, row in data.iterrows():
35 | if Hanlp(row['content']) == row['sentiment']:
36 | correct_num = correct_num + 1
37 | total_num = total_num + 1
38 | print("{}/{}".format(correct_num, total_num))
39 |
40 | print("训练集大小:{}, 正确率:{}".format(total_num, correct_num / total_num))
41 |
42 |
43 | def Hanlp(txt):
44 | headers = {'token': "8ff8c22edc774d25a52003d6b51d62061609061981838token"}
45 | data = {'text': txt}
46 | response = requests.post("http://comdo.hanlp.com/hanlp/v1/textAnalysis/sentimentAnalysis", data=data, headers=headers)
47 | s = response.content.decode('utf-8')
48 | if "情感极性是 【正面】" in s:
49 | return 1
50 | else:
51 | return 0
52 |
53 |
54 | if __name__ == "__main__":
55 | Hanlp_ORIGIN_TEST('../../dataSets/sina/样本/新浪所有新闻评论训练集.CSV')
--------------------------------------------------------------------------------
/scripts/data_process/test.py:
--------------------------------------------------------------------------------
1 | import jieba
2 | import jieba.analyse
3 | import json
4 | from wordcloud import WordCloud
5 | import pandas as pd
6 | import datetime
7 | import tensorflow as tf
8 | from pyecharts.charts import Bar
9 | from pyecharts.charts import Pie
10 | from pyecharts import options as opts
11 | from pyecharts.charts import Page
12 | from pyecharts.charts import Bar3D
13 |
14 | # 不习惯链式调用的开发者依旧可以单独调用方法
15 | # page = Page()
16 | # pie = Pie()
17 | # pie.add('示例', [('中国', 20), ('美国', 86)])
18 | # bar = Bar()
19 | # bar.add_xaxis(["衬衫", "毛衣", "领带", "裤子", "风衣", "高跟鞋", "袜子"])
20 | # bar.add_yaxis("商家A", [114, 55, 27, 101, 125, 27, 105])
21 | # bar.add_yaxis("商家B", [57, 134, 137, 129, 145, 60, 49])
22 | # bar.add_yaxis("商家C", [70, 200, 300, 15, 33, 55, 33])
23 | # bar.set_global_opts(title_opts=opts.TitleOpts(title="某商场销售情况"))
24 | # pie.set_global_opts(title_opts=opts.TitleOpts(title='示例'))
25 | # page.add(pie)
26 | # page.add(bar)
27 | # page.render('../../ECharts/page.html')
28 |
29 |
30 | if __name__ == "__main__":
31 | date = [
32 | "01-01",
33 | "01-02",
34 | "01-03",
35 | "01-04",
36 | "01-05",
37 | "01-06",
38 | "01-07",
39 | "01-08",
40 | "01-09",
41 | "01-10",
42 | "01-11",
43 | "01-12",
44 | "01-13",
45 | "01-14",
46 | "01-15",
47 | "01-16",
48 | "01-17",
49 | "01-18",
50 | "01-19",
51 | "01-20",
52 | "01-21",
53 | "01-22",
54 | "01-23",
55 | "01-24",
56 | ]
57 | channel = ["国内", "国外", "社会", "财经", "娱乐", "看点", "疫情"]
58 |
59 | data = [
60 | [0, 0, 5],
61 | [0, 1, 1],
62 | [0, 2, 0],
63 | [0, 3, 0],
64 | [0, 4, 0],
65 | [0, 5, 0],
66 | [0, 6, 0],
67 | [0, 7, 0],
68 | [0, 8, 0],
69 | [0, 9, 0],
70 | [0, 10, 0],
71 | [0, 11, 2],
72 | [0, 12, 4],
73 | [0, 13, 1],
74 | [0, 14, 1],
75 | [0, 15, 3],
76 | [0, 16, 4],
77 | [0, 17, 6],
78 | [0, 18, 4],
79 | [0, 19, 4],
80 | [0, 20, 3],
81 | [0, 21, 3],
82 | [0, 22, 2],
83 | [0, 23, 5],
84 | [1, 0, 7],
85 | [1, 1, 0],
86 | [1, 2, 0],
87 | [1, 3, 0],
88 | [1, 4, 0],
89 | [1, 5, 0],
90 | [1, 6, 0],
91 | [1, 7, 0],
92 | [1, 8, 0],
93 | [1, 9, 0],
94 | [1, 10, 5],
95 | [1, 11, 2],
96 | [1, 12, 2],
97 | [1, 13, 6],
98 | [1, 14, 9],
99 | [1, 15, 11],
100 | [1, 16, 6],
101 | [1, 17, 7],
102 | [1, 18, 8],
103 | [1, 19, 12],
104 | [1, 20, 5],
105 | [1, 21, 5],
106 | [1, 22, 7],
107 | [1, 23, 2],
108 | [2, 0, 1],
109 | [2, 1, 1],
110 | [2, 2, 0],
111 | [2, 3, 0],
112 | [2, 4, 0],
113 | [2, 5, 0],
114 | [2, 6, 0],
115 | [2, 7, 0],
116 | [2, 8, 0],
117 | [2, 9, 0],
118 | [2, 10, 3],
119 | [2, 11, 2],
120 | [2, 12, 1],
121 | [2, 13, 9],
122 | [2, 14, 8],
123 | [2, 15, 10],
124 | [2, 16, 6],
125 | [2, 17, 5],
126 | [2, 18, 5],
127 | [2, 19, 5],
128 | [2, 20, 7],
129 | [2, 21, 4],
130 | [2, 22, 2],
131 | [2, 23, 4],
132 | [3, 0, 7],
133 | [3, 1, 3],
134 | [3, 2, 0],
135 | [3, 3, 0],
136 | [3, 4, 0],
137 | [3, 5, 0],
138 | [3, 6, 0],
139 | [3, 7, 0],
140 | [3, 8, 1],
141 | [3, 9, 0],
142 | [3, 10, 5],
143 | [3, 11, 4],
144 | [3, 12, 7],
145 | [3, 13, 14],
146 | [3, 14, 13],
147 | [3, 15, 12],
148 | [3, 16, 9],
149 | [3, 17, 5],
150 | [3, 18, 5],
151 | [3, 19, 10],
152 | [3, 20, 6],
153 | [3, 21, 4],
154 | [3, 22, 4],
155 | [3, 23, 1],
156 | [4, 0, 1],
157 | [4, 1, 3],
158 | [4, 2, 0],
159 | [4, 3, 0],
160 | [4, 4, 0],
161 | [4, 5, 1],
162 | [4, 6, 0],
163 | [4, 7, 0],
164 | [4, 8, 0],
165 | [4, 9, 2],
166 | [4, 10, 4],
167 | [4, 11, 4],
168 | [4, 12, 2],
169 | [4, 13, 4],
170 | [4, 14, 4],
171 | [4, 15, 14],
172 | [4, 16, 12],
173 | [4, 17, 1],
174 | [4, 18, 8],
175 | [4, 19, 5],
176 | [4, 20, 3],
177 | [4, 21, 7],
178 | [4, 22, 3],
179 | [4, 23, 0],
180 | [5, 0, 2],
181 | [5, 1, 1],
182 | [5, 2, 0],
183 | [5, 3, 3],
184 | [5, 4, 0],
185 | [5, 5, 0],
186 | [5, 6, 0],
187 | [5, 7, 0],
188 | [5, 8, 2],
189 | [5, 9, 0],
190 | [5, 10, 4],
191 | [5, 11, 1],
192 | [5, 12, 5],
193 | [5, 13, 10],
194 | [5, 14, 5],
195 | [5, 15, 7],
196 | [5, 16, 11],
197 | [5, 17, 6],
198 | [5, 18, 0],
199 | [5, 19, 5],
200 | [5, 20, 3],
201 | [5, 21, 4],
202 | [5, 22, 2],
203 | [5, 23, 0],
204 | [6, 0, 1],
205 | [6, 1, 0],
206 | [6, 2, 0],
207 | [6, 3, 0],
208 | [6, 4, 0],
209 | [6, 5, 0],
210 | [6, 6, 0],
211 | [6, 7, 0],
212 | [6, 8, 0],
213 | [6, 9, 0],
214 | [6, 10, 1],
215 | [6, 11, 0],
216 | [6, 12, 2],
217 | [6, 13, 1],
218 | [6, 14, 3],
219 | [6, 15, 4],
220 | [6, 16, 0],
221 | [6, 17, 0],
222 | [6, 18, 0],
223 | [6, 19, 0],
224 | [6, 20, 1],
225 | [6, 21, 2],
226 | [6, 22, 2],
227 | [6, 23, 6],
228 | ]
229 | data = [[d[1], d[0], d[2]] for d in data]
230 |
231 | (
232 | Bar3D(init_opts=opts.InitOpts(width="1600px", height="800px"))
233 | .add(
234 | series_name="",
235 | data=data,
236 | xaxis3d_opts=opts.Axis3DOpts(type_="category", data=date),
237 | yaxis3d_opts=opts.Axis3DOpts(type_="category", data=channel),
238 | zaxis3d_opts=opts.Axis3DOpts(type_="value"),
239 | )
240 | .set_global_opts(
241 | visualmap_opts=opts.VisualMapOpts(
242 | max_=30,
243 | range_color=[
244 | "#313695",
245 | "#4575b4",
246 | "#74add1",
247 | "#abd9e9",
248 | "#e0f3f8",
249 | "#ffffbf",
250 | "#fee090",
251 | "#fdae61",
252 | "#f46d43",
253 | "#d73027",
254 | "#a50026",
255 | ],
256 | )
257 | )
258 | .render("../../ECharts/3dBar.html")
259 | )
260 |
261 |
262 |
263 |
--------------------------------------------------------------------------------
/stopwords/baidu_stopwords.txt:
--------------------------------------------------------------------------------
1 | --
2 | ?
3 | “
4 | ”
5 | 》
6 | --
7 | able
8 | about
9 | above
10 | according
11 | accordingly
12 | across
13 | actually
14 | after
15 | afterwards
16 | again
17 | against
18 | ain't
19 | all
20 | allow
21 | allows
22 | almost
23 | alone
24 | along
25 | already
26 | also
27 | although
28 | always
29 | am
30 | among
31 | amongst
32 | an
33 | and
34 | another
35 | any
36 | anybody
37 | anyhow
38 | anyone
39 | anything
40 | anyway
41 | anyways
42 | anywhere
43 | apart
44 | appear
45 | appreciate
46 | appropriate
47 | are
48 | aren't
49 | around
50 | as
51 | a's
52 | aside
53 | ask
54 | asking
55 | associated
56 | at
57 | available
58 | away
59 | awfully
60 | be
61 | became
62 | because
63 | become
64 | becomes
65 | becoming
66 | been
67 | before
68 | beforehand
69 | behind
70 | being
71 | believe
72 | below
73 | beside
74 | besides
75 | best
76 | better
77 | between
78 | beyond
79 | both
80 | brief
81 | but
82 | by
83 | came
84 | can
85 | cannot
86 | cant
87 | can't
88 | cause
89 | causes
90 | certain
91 | certainly
92 | changes
93 | clearly
94 | c'mon
95 | co
96 | com
97 | come
98 | comes
99 | concerning
100 | consequently
101 | consider
102 | considering
103 | contain
104 | containing
105 | contains
106 | corresponding
107 | could
108 | couldn't
109 | course
110 | c's
111 | currently
112 | definitely
113 | described
114 | despite
115 | did
116 | didn't
117 | different
118 | do
119 | does
120 | doesn't
121 | doing
122 | done
123 | don't
124 | down
125 | downwards
126 | during
127 | each
128 | edu
129 | eg
130 | eight
131 | either
132 | else
133 | elsewhere
134 | enough
135 | entirely
136 | especially
137 | et
138 | etc
139 | even
140 | ever
141 | every
142 | everybody
143 | everyone
144 | everything
145 | everywhere
146 | ex
147 | exactly
148 | example
149 | except
150 | far
151 | few
152 | fifth
153 | first
154 | five
155 | followed
156 | following
157 | follows
158 | for
159 | former
160 | formerly
161 | forth
162 | four
163 | from
164 | further
165 | furthermore
166 | get
167 | gets
168 | getting
169 | given
170 | gives
171 | go
172 | goes
173 | going
174 | gone
175 | got
176 | gotten
177 | greetings
178 | had
179 | hadn't
180 | happens
181 | hardly
182 | has
183 | hasn't
184 | have
185 | haven't
186 | having
187 | he
188 | hello
189 | help
190 | hence
191 | her
192 | here
193 | hereafter
194 | hereby
195 | herein
196 | here's
197 | hereupon
198 | hers
199 | herself
200 | he's
201 | hi
202 | him
203 | himself
204 | his
205 | hither
206 | hopefully
207 | how
208 | howbeit
209 | however
210 | i'd
211 | ie
212 | if
213 | ignored
214 | i'll
215 | i'm
216 | immediate
217 | in
218 | inasmuch
219 | inc
220 | indeed
221 | indicate
222 | indicated
223 | indicates
224 | inner
225 | insofar
226 | instead
227 | into
228 | inward
229 | is
230 | isn't
231 | it
232 | it'd
233 | it'll
234 | its
235 | it's
236 | itself
237 | i've
238 | just
239 | keep
240 | keeps
241 | kept
242 | know
243 | known
244 | knows
245 | last
246 | lately
247 | later
248 | latter
249 | latterly
250 | least
251 | less
252 | lest
253 | let
254 | let's
255 | like
256 | liked
257 | likely
258 | little
259 | look
260 | looking
261 | looks
262 | ltd
263 | mainly
264 | many
265 | may
266 | maybe
267 | me
268 | mean
269 | meanwhile
270 | merely
271 | might
272 | more
273 | moreover
274 | most
275 | mostly
276 | much
277 | must
278 | my
279 | myself
280 | name
281 | namely
282 | nd
283 | near
284 | nearly
285 | necessary
286 | need
287 | needs
288 | neither
289 | never
290 | nevertheless
291 | new
292 | next
293 | nine
294 | no
295 | nobody
296 | non
297 | none
298 | noone
299 | nor
300 | normally
301 | not
302 | nothing
303 | novel
304 | now
305 | nowhere
306 | obviously
307 | of
308 | off
309 | often
310 | oh
311 | ok
312 | okay
313 | old
314 | on
315 | once
316 | one
317 | ones
318 | only
319 | onto
320 | or
321 | other
322 | others
323 | otherwise
324 | ought
325 | our
326 | ours
327 | ourselves
328 | out
329 | outside
330 | over
331 | overall
332 | own
333 | particular
334 | particularly
335 | per
336 | perhaps
337 | placed
338 | please
339 | plus
340 | possible
341 | presumably
342 | probably
343 | provides
344 | que
345 | quite
346 | qv
347 | rather
348 | rd
349 | re
350 | really
351 | reasonably
352 | regarding
353 | regardless
354 | regards
355 | relatively
356 | respectively
357 | right
358 | said
359 | same
360 | saw
361 | say
362 | saying
363 | says
364 | second
365 | secondly
366 | see
367 | seeing
368 | seem
369 | seemed
370 | seeming
371 | seems
372 | seen
373 | self
374 | selves
375 | sensible
376 | sent
377 | serious
378 | seriously
379 | seven
380 | several
381 | shall
382 | she
383 | should
384 | shouldn't
385 | since
386 | six
387 | so
388 | some
389 | somebody
390 | somehow
391 | someone
392 | something
393 | sometime
394 | sometimes
395 | somewhat
396 | somewhere
397 | soon
398 | sorry
399 | specified
400 | specify
401 | specifying
402 | still
403 | sub
404 | such
405 | sup
406 | sure
407 | take
408 | taken
409 | tell
410 | tends
411 | th
412 | than
413 | thank
414 | thanks
415 | thanx
416 | that
417 | thats
418 | that's
419 | the
420 | their
421 | theirs
422 | them
423 | themselves
424 | then
425 | thence
426 | there
427 | thereafter
428 | thereby
429 | therefore
430 | therein
431 | theres
432 | there's
433 | thereupon
434 | these
435 | they
436 | they'd
437 | they'll
438 | they're
439 | they've
440 | think
441 | third
442 | this
443 | thorough
444 | thoroughly
445 | those
446 | though
447 | three
448 | through
449 | throughout
450 | thru
451 | thus
452 | to
453 | together
454 | too
455 | took
456 | toward
457 | towards
458 | tried
459 | tries
460 | truly
461 | try
462 | trying
463 | t's
464 | twice
465 | two
466 | un
467 | under
468 | unfortunately
469 | unless
470 | unlikely
471 | until
472 | unto
473 | up
474 | upon
475 | us
476 | use
477 | used
478 | useful
479 | uses
480 | using
481 | usually
482 | value
483 | various
484 | very
485 | via
486 | viz
487 | vs
488 | want
489 | wants
490 | was
491 | wasn't
492 | way
493 | we
494 | we'd
495 | welcome
496 | well
497 | we'll
498 | went
499 | were
500 | we're
501 | weren't
502 | we've
503 | what
504 | whatever
505 | what's
506 | when
507 | whence
508 | whenever
509 | where
510 | whereafter
511 | whereas
512 | whereby
513 | wherein
514 | where's
515 | whereupon
516 | wherever
517 | whether
518 | which
519 | while
520 | whither
521 | who
522 | whoever
523 | whole
524 | whom
525 | who's
526 | whose
527 | why
528 | will
529 | willing
530 | wish
531 | with
532 | within
533 | without
534 | wonder
535 | won't
536 | would
537 | wouldn't
538 | yes
539 | yet
540 | you
541 | you'd
542 | you'll
543 | your
544 | you're
545 | yours
546 | yourself
547 | yourselves
548 | you've
549 | zero
550 | zt
551 | ZT
552 | zz
553 | ZZ
554 | 一
555 | 一下
556 | 一些
557 | 一切
558 | 一则
559 | 一天
560 | 一定
561 | 一方面
562 | 一旦
563 | 一时
564 | 一来
565 | 一样
566 | 一次
567 | 一片
568 | 一直
569 | 一致
570 | 一般
571 | 一起
572 | 一边
573 | 一面
574 | 万一
575 | 上下
576 | 上升
577 | 上去
578 | 上来
579 | 上述
580 | 上面
581 | 下列
582 | 下去
583 | 下来
584 | 下面
585 | 不一
586 | 不久
587 | 不仅
588 | 不会
589 | 不但
590 | 不光
591 | 不单
592 | 不变
593 | 不只
594 | 不可
595 | 不同
596 | 不够
597 | 不如
598 | 不得
599 | 不怕
600 | 不惟
601 | 不成
602 | 不拘
603 | 不敢
604 | 不断
605 | 不是
606 | 不比
607 | 不然
608 | 不特
609 | 不独
610 | 不管
611 | 不能
612 | 不要
613 | 不论
614 | 不足
615 | 不过
616 | 不问
617 | 与
618 | 与其
619 | 与否
620 | 与此同时
621 | 专门
622 | 且
623 | 两者
624 | 严格
625 | 严重
626 | 个
627 | 个人
628 | 个别
629 | 中小
630 | 中间
631 | 丰富
632 | 临
633 | 为
634 | 为主
635 | 为了
636 | 为什么
637 | 为什麽
638 | 为何
639 | 为着
640 | 主张
641 | 主要
642 | 举行
643 | 乃
644 | 乃至
645 | 么
646 | 之
647 | 之一
648 | 之前
649 | 之后
650 | 之後
651 | 之所以
652 | 之类
653 | 乌乎
654 | 乎
655 | 乘
656 | 也
657 | 也好
658 | 也是
659 | 也罢
660 | 了
661 | 了解
662 | 争取
663 | 于
664 | 于是
665 | 于是乎
666 | 云云
667 | 互相
668 | 产生
669 | 人们
670 | 人家
671 | 什么
672 | 什么样
673 | 什麽
674 | 今后
675 | 今天
676 | 今年
677 | 今後
678 | 仍然
679 | 从
680 | 从事
681 | 从而
682 | 他
683 | 他人
684 | 他们
685 | 他的
686 | 代替
687 | 以
688 | 以上
689 | 以下
690 | 以为
691 | 以便
692 | 以免
693 | 以前
694 | 以及
695 | 以后
696 | 以外
697 | 以後
698 | 以来
699 | 以至
700 | 以至于
701 | 以致
702 | 们
703 | 任
704 | 任何
705 | 任凭
706 | 任务
707 | 企图
708 | 伟大
709 | 似乎
710 | 似的
711 | 但
712 | 但是
713 | 何
714 | 何况
715 | 何处
716 | 何时
717 | 作为
718 | 你
719 | 你们
720 | 你的
721 | 使得
722 | 使用
723 | 例如
724 | 依
725 | 依照
726 | 依靠
727 | 促进
728 | 保持
729 | 俺
730 | 俺们
731 | 倘
732 | 倘使
733 | 倘或
734 | 倘然
735 | 倘若
736 | 假使
737 | 假如
738 | 假若
739 | 做到
740 | 像
741 | 允许
742 | 充分
743 | 先后
744 | 先後
745 | 先生
746 | 全部
747 | 全面
748 | 兮
749 | 共同
750 | 关于
751 | 其
752 | 其一
753 | 其中
754 | 其二
755 | 其他
756 | 其余
757 | 其它
758 | 其实
759 | 其次
760 | 具体
761 | 具体地说
762 | 具体说来
763 | 具有
764 | 再者
765 | 再说
766 | 冒
767 | 冲
768 | 决定
769 | 况且
770 | 准备
771 | 几
772 | 几乎
773 | 几时
774 | 凭
775 | 凭借
776 | 出去
777 | 出来
778 | 出现
779 | 分别
780 | 则
781 | 别
782 | 别的
783 | 别说
784 | 到
785 | 前后
786 | 前者
787 | 前进
788 | 前面
789 | 加之
790 | 加以
791 | 加入
792 | 加强
793 | 十分
794 | 即
795 | 即令
796 | 即使
797 | 即便
798 | 即或
799 | 即若
800 | 却不
801 | 原来
802 | 又
803 | 及
804 | 及其
805 | 及时
806 | 及至
807 | 双方
808 | 反之
809 | 反应
810 | 反映
811 | 反过来
812 | 反过来说
813 | 取得
814 | 受到
815 | 变成
816 | 另
817 | 另一方面
818 | 另外
819 | 只是
820 | 只有
821 | 只要
822 | 只限
823 | 叫
824 | 叫做
825 | 召开
826 | 叮咚
827 | 可
828 | 可以
829 | 可是
830 | 可能
831 | 可见
832 | 各
833 | 各个
834 | 各人
835 | 各位
836 | 各地
837 | 各种
838 | 各级
839 | 各自
840 | 合理
841 | 同
842 | 同一
843 | 同时
844 | 同样
845 | 后来
846 | 后面
847 | 向
848 | 向着
849 | 吓
850 | 吗
851 | 否则
852 | 吧
853 | 吧哒
854 | 吱
855 | 呀
856 | 呃
857 | 呕
858 | 呗
859 | 呜
860 | 呜呼
861 | 呢
862 | 周围
863 | 呵
864 | 呸
865 | 呼哧
866 | 咋
867 | 和
868 | 咚
869 | 咦
870 | 咱
871 | 咱们
872 | 咳
873 | 哇
874 | 哈
875 | 哈哈
876 | 哉
877 | 哎
878 | 哎呀
879 | 哎哟
880 | 哗
881 | 哟
882 | 哦
883 | 哩
884 | 哪
885 | 哪个
886 | 哪些
887 | 哪儿
888 | 哪天
889 | 哪年
890 | 哪怕
891 | 哪样
892 | 哪边
893 | 哪里
894 | 哼
895 | 哼唷
896 | 唉
897 | 啊
898 | 啐
899 | 啥
900 | 啦
901 | 啪达
902 | 喂
903 | 喏
904 | 喔唷
905 | 嗡嗡
906 | 嗬
907 | 嗯
908 | 嗳
909 | 嘎
910 | 嘎登
911 | 嘘
912 | 嘛
913 | 嘻
914 | 嘿
915 | 因
916 | 因为
917 | 因此
918 | 因而
919 | 固然
920 | 在
921 | 在下
922 | 地
923 | 坚决
924 | 坚持
925 | 基本
926 | 处理
927 | 复杂
928 | 多
929 | 多少
930 | 多数
931 | 多次
932 | 大力
933 | 大多数
934 | 大大
935 | 大家
936 | 大批
937 | 大约
938 | 大量
939 | 失去
940 | 她
941 | 她们
942 | 她的
943 | 好的
944 | 好象
945 | 如
946 | 如上所述
947 | 如下
948 | 如何
949 | 如其
950 | 如果
951 | 如此
952 | 如若
953 | 存在
954 | 宁
955 | 宁可
956 | 宁愿
957 | 宁肯
958 | 它
959 | 它们
960 | 它们的
961 | 它的
962 | 安全
963 | 完全
964 | 完成
965 | 实现
966 | 实际
967 | 宣布
968 | 容易
969 | 密切
970 | 对
971 | 对于
972 | 对应
973 | 将
974 | 少数
975 | 尔后
976 | 尚且
977 | 尤其
978 | 就
979 | 就是
980 | 就是说
981 | 尽
982 | 尽管
983 | 属于
984 | 岂但
985 | 左右
986 | 巨大
987 | 巩固
988 | 己
989 | 已经
990 | 帮助
991 | 常常
992 | 并
993 | 并不
994 | 并不是
995 | 并且
996 | 并没有
997 | 广大
998 | 广泛
999 | 应当
1000 | 应用
1001 | 应该
1002 | 开外
1003 | 开始
1004 | 开展
1005 | 引起
1006 | 强烈
1007 | 强调
1008 | 归
1009 | 当
1010 | 当前
1011 | 当时
1012 | 当然
1013 | 当着
1014 | 形成
1015 | 彻底
1016 | 彼
1017 | 彼此
1018 | 往
1019 | 往往
1020 | 待
1021 | 後来
1022 | 後面
1023 | 得
1024 | 得出
1025 | 得到
1026 | 心里
1027 | 必然
1028 | 必要
1029 | 必须
1030 | 怎
1031 | 怎么
1032 | 怎么办
1033 | 怎么样
1034 | 怎样
1035 | 怎麽
1036 | 总之
1037 | 总是
1038 | 总的来看
1039 | 总的来说
1040 | 总的说来
1041 | 总结
1042 | 总而言之
1043 | 恰恰相反
1044 | 您
1045 | 意思
1046 | 愿意
1047 | 慢说
1048 | 成为
1049 | 我
1050 | 我们
1051 | 我的
1052 | 或
1053 | 或是
1054 | 或者
1055 | 战斗
1056 | 所
1057 | 所以
1058 | 所有
1059 | 所谓
1060 | 打
1061 | 扩大
1062 | 把
1063 | 抑或
1064 | 拿
1065 | 按
1066 | 按照
1067 | 换句话说
1068 | 换言之
1069 | 据
1070 | 掌握
1071 | 接着
1072 | 接著
1073 | 故
1074 | 故此
1075 | 整个
1076 | 方便
1077 | 方面
1078 | 旁人
1079 | 无宁
1080 | 无法
1081 | 无论
1082 | 既
1083 | 既是
1084 | 既然
1085 | 时候
1086 | 明显
1087 | 明确
1088 | 是
1089 | 是否
1090 | 是的
1091 | 显然
1092 | 显著
1093 | 普通
1094 | 普遍
1095 | 更加
1096 | 曾经
1097 | 替
1098 | 最后
1099 | 最大
1100 | 最好
1101 | 最後
1102 | 最近
1103 | 最高
1104 | 有
1105 | 有些
1106 | 有关
1107 | 有利
1108 | 有力
1109 | 有所
1110 | 有效
1111 | 有时
1112 | 有点
1113 | 有的
1114 | 有着
1115 | 有著
1116 | 望
1117 | 朝
1118 | 朝着
1119 | 本
1120 | 本着
1121 | 来
1122 | 来着
1123 | 极了
1124 | 构成
1125 | 果然
1126 | 果真
1127 | 某
1128 | 某个
1129 | 某些
1130 | 根据
1131 | 根本
1132 | 欢迎
1133 | 正在
1134 | 正如
1135 | 正常
1136 | 此
1137 | 此外
1138 | 此时
1139 | 此间
1140 | 毋宁
1141 | 每
1142 | 每个
1143 | 每天
1144 | 每年
1145 | 每当
1146 | 比
1147 | 比如
1148 | 比方
1149 | 比较
1150 | 毫不
1151 | 没有
1152 | 沿
1153 | 沿着
1154 | 注意
1155 | 深入
1156 | 清楚
1157 | 满足
1158 | 漫说
1159 | 焉
1160 | 然则
1161 | 然后
1162 | 然後
1163 | 然而
1164 | 照
1165 | 照着
1166 | 特别是
1167 | 特殊
1168 | 特点
1169 | 现代
1170 | 现在
1171 | 甚么
1172 | 甚而
1173 | 甚至
1174 | 用
1175 | 由
1176 | 由于
1177 | 由此可见
1178 | 的
1179 | 的话
1180 | 目前
1181 | 直到
1182 | 直接
1183 | 相似
1184 | 相信
1185 | 相反
1186 | 相同
1187 | 相对
1188 | 相对而言
1189 | 相应
1190 | 相当
1191 | 相等
1192 | 省得
1193 | 看出
1194 | 看到
1195 | 看来
1196 | 看看
1197 | 看见
1198 | 真是
1199 | 真正
1200 | 着
1201 | 着呢
1202 | 矣
1203 | 知道
1204 | 确定
1205 | 离
1206 | 积极
1207 | 移动
1208 | 突出
1209 | 突然
1210 | 立即
1211 | 第
1212 | 等
1213 | 等等
1214 | 管
1215 | 紧接着
1216 | 纵
1217 | 纵令
1218 | 纵使
1219 | 纵然
1220 | 练习
1221 | 组成
1222 | 经
1223 | 经常
1224 | 经过
1225 | 结合
1226 | 结果
1227 | 给
1228 | 绝对
1229 | 继续
1230 | 继而
1231 | 维持
1232 | 综上所述
1233 | 罢了
1234 | 考虑
1235 | 者
1236 | 而
1237 | 而且
1238 | 而况
1239 | 而外
1240 | 而已
1241 | 而是
1242 | 而言
1243 | 联系
1244 | 能
1245 | 能否
1246 | 能够
1247 | 腾
1248 | 自
1249 | 自个儿
1250 | 自从
1251 | 自各儿
1252 | 自家
1253 | 自己
1254 | 自身
1255 | 至
1256 | 至于
1257 | 良好
1258 | 若
1259 | 若是
1260 | 若非
1261 | 范围
1262 | 莫若
1263 | 获得
1264 | 虽
1265 | 虽则
1266 | 虽然
1267 | 虽说
1268 | 行为
1269 | 行动
1270 | 表明
1271 | 表示
1272 | 被
1273 | 要
1274 | 要不
1275 | 要不是
1276 | 要不然
1277 | 要么
1278 | 要是
1279 | 要求
1280 | 规定
1281 | 觉得
1282 | 认为
1283 | 认真
1284 | 认识
1285 | 让
1286 | 许多
1287 | 论
1288 | 设使
1289 | 设若
1290 | 该
1291 | 说明
1292 | 诸位
1293 | 谁
1294 | 谁知
1295 | 赶
1296 | 起
1297 | 起来
1298 | 起见
1299 | 趁
1300 | 趁着
1301 | 越是
1302 | 跟
1303 | 转动
1304 | 转变
1305 | 转贴
1306 | 较
1307 | 较之
1308 | 边
1309 | 达到
1310 | 迅速
1311 | 过
1312 | 过去
1313 | 过来
1314 | 运用
1315 | 还是
1316 | 还有
1317 | 这
1318 | 这个
1319 | 这么
1320 | 这么些
1321 | 这么样
1322 | 这么点儿
1323 | 这些
1324 | 这会儿
1325 | 这儿
1326 | 这就是说
1327 | 这时
1328 | 这样
1329 | 这点
1330 | 这种
1331 | 这边
1332 | 这里
1333 | 这麽
1334 | 进入
1335 | 进步
1336 | 进而
1337 | 进行
1338 | 连
1339 | 连同
1340 | 适应
1341 | 适当
1342 | 适用
1343 | 逐步
1344 | 逐渐
1345 | 通常
1346 | 通过
1347 | 造成
1348 | 遇到
1349 | 遭到
1350 | 避免
1351 | 那
1352 | 那个
1353 | 那么
1354 | 那么些
1355 | 那么样
1356 | 那些
1357 | 那会儿
1358 | 那儿
1359 | 那时
1360 | 那样
1361 | 那边
1362 | 那里
1363 | 那麽
1364 | 部分
1365 | 鄙人
1366 | 采取
1367 | 里面
1368 | 重大
1369 | 重新
1370 | 重要
1371 | 鉴于
1372 | 问题
1373 | 防止
1374 | 阿
1375 | 附近
1376 | 限制
1377 | 除
1378 | 除了
1379 | 除此之外
1380 | 除非
1381 | 随
1382 | 随着
1383 | 随著
1384 | 集中
1385 | 需要
1386 | 非但
1387 | 非常
1388 | 非徒
1389 | 靠
1390 | 顺
1391 | 顺着
1392 | 首先
1393 | 高兴
1394 | 是不是
1395 | 说说
1396 | 新浪
1397 | 新浪网
1398 |
1399 |
--------------------------------------------------------------------------------
/stopwords/cn_stopwords.txt:
--------------------------------------------------------------------------------
1 | $
2 | 0
3 | 1
4 | 2
5 | 3
6 | 4
7 | 5
8 | 6
9 | 7
10 | 8
11 | 9
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 | 了
97 | 二来
98 | 于
99 | 于是
100 | 于是乎
101 | 云云
102 | 云尔
103 | 些
104 | 亦
105 | 人
106 | 人们
107 | 人家
108 | 什么
109 | 什么样
110 | 今
111 | 介于
112 | 仍
113 | 仍旧
114 | 从
115 | 从此
116 | 从而
117 | 他
118 | 他人
119 | 他们
120 | 以
121 | 以上
122 | 以为
123 | 以便
124 | 以免
125 | 以及
126 | 以故
127 | 以期
128 | 以来
129 | 以至
130 | 以至于
131 | 以致
132 | 们
133 | 任
134 | 任何
135 | 任凭
136 | 似的
137 | 但
138 | 但凡
139 | 但是
140 | 何
141 | 何以
142 | 何况
143 | 何处
144 | 何时
145 | 余外
146 | 作为
147 | 你
148 | 你们
149 | 使
150 | 使得
151 | 例如
152 | 依
153 | 依据
154 | 依照
155 | 便于
156 | 俺
157 | 俺们
158 | 倘
159 | 倘使
160 | 倘或
161 | 倘然
162 | 倘若
163 | 借
164 | 假使
165 | 假如
166 | 假若
167 | 傥然
168 | 像
169 | 儿
170 | 先不先
171 | 光是
172 | 全体
173 | 全部
174 | 兮
175 | 关于
176 | 其
177 | 其一
178 | 其中
179 | 其二
180 | 其他
181 | 其余
182 | 其它
183 | 其次
184 | 具体地说
185 | 具体说来
186 | 兼之
187 | 内
188 | 再
189 | 再其次
190 | 再则
191 | 再有
192 | 再者
193 | 再者说
194 | 再说
195 | 冒
196 | 冲
197 | 况且
198 | 几
199 | 几时
200 | 凡
201 | 凡是
202 | 凭
203 | 凭借
204 | 出于
205 | 出来
206 | 分别
207 | 则
208 | 则甚
209 | 别
210 | 别人
211 | 别处
212 | 别是
213 | 别的
214 | 别管
215 | 别说
216 | 到
217 | 前后
218 | 前此
219 | 前者
220 | 加之
221 | 加以
222 | 即
223 | 即令
224 | 即使
225 | 即便
226 | 即如
227 | 即或
228 | 即若
229 | 却
230 | 去
231 | 又
232 | 又及
233 | 及
234 | 及其
235 | 及至
236 | 反之
237 | 反而
238 | 反过来
239 | 反过来说
240 | 受到
241 | 另
242 | 另一方面
243 | 另外
244 | 另悉
245 | 只
246 | 只当
247 | 只怕
248 | 只是
249 | 只有
250 | 只消
251 | 只要
252 | 只限
253 | 叫
254 | 叮咚
255 | 可
256 | 可以
257 | 可是
258 | 可见
259 | 各
260 | 各个
261 | 各位
262 | 各种
263 | 各自
264 | 同
265 | 同时
266 | 后
267 | 后者
268 | 向
269 | 向使
270 | 向着
271 | 吓
272 | 吗
273 | 否则
274 | 吧
275 | 吧哒
276 | 吱
277 | 呀
278 | 呃
279 | 呕
280 | 呗
281 | 呜
282 | 呜呼
283 | 呢
284 | 呵
285 | 呵呵
286 | 呸
287 | 呼哧
288 | 咋
289 | 和
290 | 咚
291 | 咦
292 | 咧
293 | 咱
294 | 咱们
295 | 咳
296 | 哇
297 | 哈
298 | 哈哈
299 | 哉
300 | 哎
301 | 哎呀
302 | 哎哟
303 | 哗
304 | 哟
305 | 哦
306 | 哩
307 | 哪
308 | 哪个
309 | 哪些
310 | 哪儿
311 | 哪天
312 | 哪年
313 | 哪怕
314 | 哪样
315 | 哪边
316 | 哪里
317 | 哼
318 | 哼唷
319 | 唉
320 | 唯有
321 | 啊
322 | 啐
323 | 啥
324 | 啦
325 | 啪达
326 | 啷当
327 | 喂
328 | 喏
329 | 喔唷
330 | 喽
331 | 嗡
332 | 嗡嗡
333 | 嗬
334 | 嗯
335 | 嗳
336 | 嘎
337 | 嘎登
338 | 嘘
339 | 嘛
340 | 嘻
341 | 嘿
342 | 嘿嘿
343 | 因
344 | 因为
345 | 因了
346 | 因此
347 | 因着
348 | 因而
349 | 固然
350 | 在
351 | 在下
352 | 在于
353 | 地
354 | 基于
355 | 处在
356 | 多
357 | 多么
358 | 多少
359 | 大
360 | 大家
361 | 她
362 | 她们
363 | 好
364 | 如
365 | 如上
366 | 如上所述
367 | 如下
368 | 如何
369 | 如其
370 | 如同
371 | 如是
372 | 如果
373 | 如此
374 | 如若
375 | 始而
376 | 孰料
377 | 孰知
378 | 宁
379 | 宁可
380 | 宁愿
381 | 宁肯
382 | 它
383 | 它们
384 | 对
385 | 对于
386 | 对待
387 | 对方
388 | 对比
389 | 将
390 | 小
391 | 尔
392 | 尔后
393 | 尔尔
394 | 尚且
395 | 就
396 | 就是
397 | 就是了
398 | 就是说
399 | 就算
400 | 就要
401 | 尽
402 | 尽管
403 | 尽管如此
404 | 岂但
405 | 己
406 | 已
407 | 已矣
408 | 巴
409 | 巴巴
410 | 并
411 | 并且
412 | 并非
413 | 庶乎
414 | 庶几
415 | 开外
416 | 开始
417 | 归
418 | 归齐
419 | 当
420 | 当地
421 | 当然
422 | 当着
423 | 彼
424 | 彼时
425 | 彼此
426 | 往
427 | 待
428 | 很
429 | 得
430 | 得了
431 | 怎
432 | 怎么
433 | 怎么办
434 | 怎么样
435 | 怎奈
436 | 怎样
437 | 总之
438 | 总的来看
439 | 总的来说
440 | 总的说来
441 | 总而言之
442 | 恰恰相反
443 | 您
444 | 惟其
445 | 慢说
446 | 我
447 | 我们
448 | 或
449 | 或则
450 | 或是
451 | 或曰
452 | 或者
453 | 截至
454 | 所
455 | 所以
456 | 所在
457 | 所幸
458 | 所有
459 | 才
460 | 才能
461 | 打
462 | 打从
463 | 把
464 | 抑或
465 | 拿
466 | 按
467 | 按照
468 | 换句话说
469 | 换言之
470 | 据
471 | 据此
472 | 接着
473 | 故
474 | 故此
475 | 故而
476 | 旁人
477 | 无
478 | 无宁
479 | 无论
480 | 既
481 | 既往
482 | 既是
483 | 既然
484 | 时候
485 | 是
486 | 是以
487 | 是的
488 | 曾
489 | 替
490 | 替代
491 | 最
492 | 有
493 | 有些
494 | 有关
495 | 有及
496 | 有时
497 | 有的
498 | 望
499 | 朝
500 | 朝着
501 | 本
502 | 本人
503 | 本地
504 | 本着
505 | 本身
506 | 来
507 | 来着
508 | 来自
509 | 来说
510 | 极了
511 | 果然
512 | 果真
513 | 某
514 | 某个
515 | 某些
516 | 某某
517 | 根据
518 | 欤
519 | 正值
520 | 正如
521 | 正巧
522 | 正是
523 | 此
524 | 此地
525 | 此处
526 | 此外
527 | 此时
528 | 此次
529 | 此间
530 | 毋宁
531 | 每
532 | 每当
533 | 比
534 | 比及
535 | 比如
536 | 比方
537 | 没奈何
538 | 沿
539 | 沿着
540 | 漫说
541 | 焉
542 | 然则
543 | 然后
544 | 然而
545 | 照
546 | 照着
547 | 犹且
548 | 犹自
549 | 甚且
550 | 甚么
551 | 甚或
552 | 甚而
553 | 甚至
554 | 甚至于
555 | 用
556 | 用来
557 | 由
558 | 由于
559 | 由是
560 | 由此
561 | 由此可见
562 | 的
563 | 的确
564 | 的话
565 | 直到
566 | 相对而言
567 | 省得
568 | 看
569 | 眨眼
570 | 着
571 | 着呢
572 | 矣
573 | 矣乎
574 | 矣哉
575 | 离
576 | 竟而
577 | 第
578 | 等
579 | 等到
580 | 等等
581 | 简言之
582 | 管
583 | 类如
584 | 紧接着
585 | 纵
586 | 纵令
587 | 纵使
588 | 纵然
589 | 经
590 | 经过
591 | 结果
592 | 给
593 | 继之
594 | 继后
595 | 继而
596 | 综上所述
597 | 罢了
598 | 者
599 | 而
600 | 而且
601 | 而况
602 | 而后
603 | 而外
604 | 而已
605 | 而是
606 | 而言
607 | 能
608 | 能否
609 | 腾
610 | 自
611 | 自个儿
612 | 自从
613 | 自各儿
614 | 自后
615 | 自家
616 | 自己
617 | 自打
618 | 自身
619 | 至
620 | 至于
621 | 至今
622 | 至若
623 | 致
624 | 般的
625 | 若
626 | 若夫
627 | 若是
628 | 若果
629 | 若非
630 | 莫不然
631 | 莫如
632 | 莫若
633 | 虽
634 | 虽则
635 | 虽然
636 | 虽说
637 | 被
638 | 要
639 | 要不
640 | 要不是
641 | 要不然
642 | 要么
643 | 要是
644 | 譬喻
645 | 譬如
646 | 让
647 | 许多
648 | 论
649 | 设使
650 | 设或
651 | 设若
652 | 诚如
653 | 诚然
654 | 该
655 | 说来
656 | 诸
657 | 诸位
658 | 诸如
659 | 谁
660 | 谁人
661 | 谁料
662 | 谁知
663 | 贼死
664 | 赖以
665 | 赶
666 | 起
667 | 起见
668 | 趁
669 | 趁着
670 | 越是
671 | 距
672 | 跟
673 | 较
674 | 较之
675 | 边
676 | 过
677 | 还
678 | 还是
679 | 还有
680 | 还要
681 | 这
682 | 这一来
683 | 这个
684 | 这么
685 | 这么些
686 | 这么样
687 | 这么点儿
688 | 这些
689 | 这会儿
690 | 这儿
691 | 这就是说
692 | 这时
693 | 这样
694 | 这次
695 | 这般
696 | 这边
697 | 这里
698 | 进而
699 | 连
700 | 连同
701 | 逐步
702 | 通过
703 | 遵循
704 | 遵照
705 | 那
706 | 那个
707 | 那么
708 | 那么些
709 | 那么样
710 | 那些
711 | 那会儿
712 | 那儿
713 | 那时
714 | 那样
715 | 那般
716 | 那边
717 | 那里
718 | 都
719 | 鄙人
720 | 鉴于
721 | 针对
722 | 阿
723 | 除
724 | 除了
725 | 除外
726 | 除开
727 | 除此之外
728 | 除非
729 | 随
730 | 随后
731 | 随时
732 | 随着
733 | 难道说
734 | 非但
735 | 非徒
736 | 非特
737 | 非独
738 | 靠
739 | 顺
740 | 顺着
741 | 首先
742 | !
743 | ,
744 | :
745 | ;
746 | ?
747 |
--------------------------------------------------------------------------------
/stopwords/hit_stopwords.txt:
--------------------------------------------------------------------------------
1 | ———
2 | 》),
3 | )÷(1-
4 | ”,
5 | )、
6 | =(
7 | :
8 | →
9 | ℃
10 | &
11 | *
12 | 一一
13 | ~~~~
14 | ’
15 | .
16 | 『
17 | .一
18 | ./
19 | --
20 | 』
21 | =″
22 | 【
23 | [*]
24 | }>
25 | [⑤]]
26 | [①D]
27 | c]
28 | ng昉
29 | *
30 | //
31 | [
32 | ]
33 | [②e]
34 | [②g]
35 | ={
36 | }
37 | ,也
38 | ‘
39 | A
40 | [①⑥]
41 | [②B]
42 | [①a]
43 | [④a]
44 | [①③]
45 | [③h]
46 | ③]
47 | 1.
48 | --
49 | [②b]
50 | ’‘
51 | ×××
52 | [①⑧]
53 | 0:2
54 | =[
55 | [⑤b]
56 | [②c]
57 | [④b]
58 | [②③]
59 | [③a]
60 | [④c]
61 | [①⑤]
62 | [①⑦]
63 | [①g]
64 | ∈[
65 | [①⑨]
66 | [①④]
67 | [①c]
68 | [②f]
69 | [②⑧]
70 | [②①]
71 | [①C]
72 | [③c]
73 | [③g]
74 | [②⑤]
75 | [②②]
76 | 一.
77 | [①h]
78 | .数
79 | []
80 | [①B]
81 | 数/
82 | [①i]
83 | [③e]
84 | [①①]
85 | [④d]
86 | [④e]
87 | [③b]
88 | [⑤a]
89 | [①A]
90 | [②⑧]
91 | [②⑦]
92 | [①d]
93 | [②j]
94 | 〕〔
95 | ][
96 | ://
97 | ′∈
98 | [②④
99 | [⑤e]
100 | 12%
101 | b]
102 | ...
103 | ...................
104 | …………………………………………………③
105 | ZXFITL
106 | [③F]
107 | 」
108 | [①o]
109 | ]∧′=[
110 | ∪φ∈
111 | ′|
112 | {-
113 | ②c
114 | }
115 | [③①]
116 | R.L.
117 | [①E]
118 | Ψ
119 | -[*]-
120 | ↑
121 | .日
122 | [②d]
123 | [②
124 | [②⑦]
125 | [②②]
126 | [③e]
127 | [①i]
128 | [①B]
129 | [①h]
130 | [①d]
131 | [①g]
132 | [①②]
133 | [②a]
134 | f]
135 | [⑩]
136 | a]
137 | [①e]
138 | [②h]
139 | [②⑥]
140 | [③d]
141 | [②⑩]
142 | e]
143 | 〉
144 | 】
145 | 元/吨
146 | [②⑩]
147 | 2.3%
148 | 5:0
149 | [①]
150 | ::
151 | [②]
152 | [③]
153 | [④]
154 | [⑤]
155 | [⑥]
156 | [⑦]
157 | [⑧]
158 | [⑨]
159 | ……
160 | ——
161 | ?
162 | 、
163 | 。
164 | “
165 | ”
166 | 《
167 | 》
168 | !
169 | ,
170 | :
171 | ;
172 | ?
173 | .
174 | ,
175 | .
176 | '
177 | ?
178 | ·
179 | ———
180 | ──
181 | ?
182 | —
183 | <
184 | >
185 | (
186 | )
187 | 〔
188 | 〕
189 | [
190 | ]
191 | (
192 | )
193 | -
194 | +
195 | ~
196 | ×
197 | /
198 | /
199 | ①
200 | ②
201 | ③
202 | ④
203 | ⑤
204 | ⑥
205 | ⑦
206 | ⑧
207 | ⑨
208 | ⑩
209 | Ⅲ
210 | В
211 | "
212 | ;
213 | #
214 | @
215 | γ
216 | μ
217 | φ
218 | φ.
219 | ×
220 | Δ
221 | ■
222 | ▲
223 | sub
224 | exp
225 | sup
226 | sub
227 | Lex
228 | #
229 | %
230 | &
231 | '
232 | +
233 | +ξ
234 | ++
235 | -
236 | -β
237 | <
238 | <±
239 | <Δ
240 | <λ
241 | <φ
242 | <<
243 | =
244 | =
245 | =☆
246 | =-
247 | >
248 | >λ
249 | _
250 | ~±
251 | ~+
252 | [⑤f]
253 | [⑤d]
254 | [②i]
255 | ≈
256 | [②G]
257 | [①f]
258 | LI
259 | ㈧
260 | [-
261 | ......
262 | 〉
263 | [③⑩]
264 | 第二
265 | 一番
266 | 一直
267 | 一个
268 | 一些
269 | 许多
270 | 种
271 | 有的是
272 | 也就是说
273 | 末##末
274 | 啊
275 | 阿
276 | 哎
277 | 哎呀
278 | 哎哟
279 | 唉
280 | 俺
281 | 俺们
282 | 按
283 | 按照
284 | 吧
285 | 吧哒
286 | 把
287 | 罢了
288 | 被
289 | 本
290 | 本着
291 | 比
292 | 比方
293 | 比如
294 | 鄙人
295 | 彼
296 | 彼此
297 | 边
298 | 别
299 | 别的
300 | 别说
301 | 并
302 | 并且
303 | 不比
304 | 不成
305 | 不单
306 | 不但
307 | 不独
308 | 不管
309 | 不光
310 | 不过
311 | 不仅
312 | 不拘
313 | 不论
314 | 不怕
315 | 不然
316 | 不如
317 | 不特
318 | 不惟
319 | 不问
320 | 不只
321 | 朝
322 | 朝着
323 | 趁
324 | 趁着
325 | 乘
326 | 冲
327 | 除
328 | 除此之外
329 | 除非
330 | 除了
331 | 此
332 | 此间
333 | 此外
334 | 从
335 | 从而
336 | 打
337 | 待
338 | 但
339 | 但是
340 | 当
341 | 当着
342 | 到
343 | 得
344 | 的
345 | 的话
346 | 等
347 | 等等
348 | 地
349 | 第
350 | 叮咚
351 | 对
352 | 对于
353 | 多
354 | 多少
355 | 而
356 | 而况
357 | 而且
358 | 而是
359 | 而外
360 | 而言
361 | 而已
362 | 尔后
363 | 反过来
364 | 反过来说
365 | 反之
366 | 非但
367 | 非徒
368 | 否则
369 | 嘎
370 | 嘎登
371 | 该
372 | 赶
373 | 个
374 | 各
375 | 各个
376 | 各位
377 | 各种
378 | 各自
379 | 给
380 | 根据
381 | 跟
382 | 故
383 | 故此
384 | 固然
385 | 关于
386 | 管
387 | 归
388 | 果然
389 | 果真
390 | 过
391 | 哈
392 | 哈哈
393 | 呵
394 | 和
395 | 何
396 | 何处
397 | 何况
398 | 何时
399 | 嘿
400 | 哼
401 | 哼唷
402 | 呼哧
403 | 乎
404 | 哗
405 | 还是
406 | 还有
407 | 换句话说
408 | 换言之
409 | 或
410 | 或是
411 | 或者
412 | 极了
413 | 及
414 | 及其
415 | 及至
416 | 即
417 | 即便
418 | 即或
419 | 即令
420 | 即若
421 | 即使
422 | 几
423 | 几时
424 | 己
425 | 既
426 | 既然
427 | 既是
428 | 继而
429 | 加之
430 | 假如
431 | 假若
432 | 假使
433 | 鉴于
434 | 将
435 | 较
436 | 较之
437 | 叫
438 | 接着
439 | 结果
440 | 借
441 | 紧接着
442 | 进而
443 | 尽
444 | 尽管
445 | 经
446 | 经过
447 | 就
448 | 就是
449 | 就是说
450 | 据
451 | 具体地说
452 | 具体说来
453 | 开始
454 | 开外
455 | 靠
456 | 咳
457 | 可
458 | 可见
459 | 可是
460 | 可以
461 | 况且
462 | 啦
463 | 来
464 | 来着
465 | 离
466 | 例如
467 | 哩
468 | 连
469 | 连同
470 | 两者
471 | 了
472 | 临
473 | 另
474 | 另外
475 | 另一方面
476 | 论
477 | 嘛
478 | 吗
479 | 慢说
480 | 漫说
481 | 冒
482 | 么
483 | 每
484 | 每当
485 | 们
486 | 莫若
487 | 某
488 | 某个
489 | 某些
490 | 拿
491 | 哪
492 | 哪边
493 | 哪儿
494 | 哪个
495 | 哪里
496 | 哪年
497 | 哪怕
498 | 哪天
499 | 哪些
500 | 哪样
501 | 那
502 | 那边
503 | 那儿
504 | 那个
505 | 那会儿
506 | 那里
507 | 那么
508 | 那么些
509 | 那么样
510 | 那时
511 | 那些
512 | 那样
513 | 乃
514 | 乃至
515 | 呢
516 | 能
517 | 你
518 | 你们
519 | 您
520 | 宁
521 | 宁可
522 | 宁肯
523 | 宁愿
524 | 哦
525 | 呕
526 | 啪达
527 | 旁人
528 | 呸
529 | 凭
530 | 凭借
531 | 其
532 | 其次
533 | 其二
534 | 其他
535 | 其它
536 | 其一
537 | 其余
538 | 其中
539 | 起
540 | 起见
541 | 起见
542 | 岂但
543 | 恰恰相反
544 | 前后
545 | 前者
546 | 且
547 | 然而
548 | 然后
549 | 然则
550 | 让
551 | 人家
552 | 任
553 | 任何
554 | 任凭
555 | 如
556 | 如此
557 | 如果
558 | 如何
559 | 如其
560 | 如若
561 | 如上所述
562 | 若
563 | 若非
564 | 若是
565 | 啥
566 | 上下
567 | 尚且
568 | 设若
569 | 设使
570 | 甚而
571 | 甚么
572 | 甚至
573 | 省得
574 | 时候
575 | 什么
576 | 什么样
577 | 使得
578 | 是
579 | 是的
580 | 首先
581 | 谁
582 | 谁知
583 | 顺
584 | 顺着
585 | 似的
586 | 虽
587 | 虽然
588 | 虽说
589 | 虽则
590 | 随
591 | 随着
592 | 所
593 | 所以
594 | 他
595 | 他们
596 | 他人
597 | 它
598 | 它们
599 | 她
600 | 她们
601 | 倘
602 | 倘或
603 | 倘然
604 | 倘若
605 | 倘使
606 | 腾
607 | 替
608 | 通过
609 | 同
610 | 同时
611 | 哇
612 | 万一
613 | 往
614 | 望
615 | 为
616 | 为何
617 | 为了
618 | 为什么
619 | 为着
620 | 喂
621 | 嗡嗡
622 | 我
623 | 我们
624 | 呜
625 | 呜呼
626 | 乌乎
627 | 无论
628 | 无宁
629 | 毋宁
630 | 嘻
631 | 吓
632 | 相对而言
633 | 像
634 | 向
635 | 向着
636 | 嘘
637 | 呀
638 | 焉
639 | 沿
640 | 沿着
641 | 要
642 | 要不
643 | 要不然
644 | 要不是
645 | 要么
646 | 要是
647 | 也
648 | 也罢
649 | 也好
650 | 一
651 | 一般
652 | 一旦
653 | 一方面
654 | 一来
655 | 一切
656 | 一样
657 | 一则
658 | 依
659 | 依照
660 | 矣
661 | 以
662 | 以便
663 | 以及
664 | 以免
665 | 以至
666 | 以至于
667 | 以致
668 | 抑或
669 | 因
670 | 因此
671 | 因而
672 | 因为
673 | 哟
674 | 用
675 | 由
676 | 由此可见
677 | 由于
678 | 有
679 | 有的
680 | 有关
681 | 有些
682 | 又
683 | 于
684 | 于是
685 | 于是乎
686 | 与
687 | 与此同时
688 | 与否
689 | 与其
690 | 越是
691 | 云云
692 | 哉
693 | 再说
694 | 再者
695 | 在
696 | 在下
697 | 咱
698 | 咱们
699 | 则
700 | 怎
701 | 怎么
702 | 怎么办
703 | 怎么样
704 | 怎样
705 | 咋
706 | 照
707 | 照着
708 | 者
709 | 这
710 | 这边
711 | 这儿
712 | 这个
713 | 这会儿
714 | 这就是说
715 | 这里
716 | 这么
717 | 这么点儿
718 | 这么些
719 | 这么样
720 | 这时
721 | 这些
722 | 这样
723 | 正如
724 | 吱
725 | 之
726 | 之类
727 | 之所以
728 | 之一
729 | 只是
730 | 只限
731 | 只要
732 | 只有
733 | 至
734 | 至于
735 | 诸位
736 | 着
737 | 着呢
738 | 自
739 | 自从
740 | 自个儿
741 | 自各儿
742 | 自己
743 | 自家
744 | 自身
745 | 综上所述
746 | 总的来看
747 | 总的来说
748 | 总的说来
749 | 总而言之
750 | 总之
751 | 纵
752 | 纵令
753 | 纵然
754 | 纵使
755 | 遵照
756 | 作为
757 | 兮
758 | 呃
759 | 呗
760 | 咚
761 | 咦
762 | 喏
763 | 啐
764 | 喔唷
765 | 嗬
766 | 嗯
767 | 嗳
768 |
--------------------------------------------------------------------------------
/stopwords/scu_stopwords.txt:
--------------------------------------------------------------------------------
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 | 如上所述
97 | 一方面
98 | 切不可
99 | 顷刻间
100 | 全身心
101 | 另方面
102 | 另一个
103 | 猛然间
104 | 默默地
105 | 就是说
106 | 近年来
107 | 尽可能
108 | 接下来
109 | 简言之
110 | 急匆匆
111 | 即是说
112 | 基本上
113 | 换言之
114 | 充其极
115 | 充其量
116 | 暗地里
117 | 反之则
118 | 比如说
119 | 背地里
120 | 背靠背
121 | 并没有
122 | 不得不
123 | 不得了
124 | 不得已
125 | 不仅仅
126 | 不经意
127 | 不能不
128 | 不外乎
129 | 不由得
130 | 不怎么
131 | 不至于
132 | 策略地
133 | 差不多
134 | 常言道
135 | 常言说
136 | 多年来
137 | 多年前
138 | 差一点
139 | 敞开儿
140 | 抽冷子
141 | 大不了
142 | 反倒是
143 | 反过来
144 | 大体上
145 | 当口儿
146 | 倒不如
147 | 怪不得
148 | 动不动
149 | 看起来
150 | 看上去
151 | 看样子
152 | 够瞧的
153 | 到了儿
154 | 呆呆地
155 | 来不及
156 | 来得及
157 | 到头来
158 | 连日来
159 | 于是乎
160 | 为什么
161 | 这会儿
162 | 换言之
163 | 那会儿
164 | 那么些
165 | 那么样
166 | 什么样
167 | 反过来
168 | 紧接着
169 | 就是说
170 | 要不然
171 | 要不是
172 | 一方面
173 | 以至于
174 | 自个儿
175 | 自各儿
176 | 之所以
177 | 这么些
178 | 这么样
179 | 怎么办
180 | 怎么样
181 | 谁知
182 | 顺着
183 | 似的
184 | 虽然
185 | 虽说
186 | 虽则
187 | 随着
188 | 所以
189 | 他们
190 | 他人
191 | 它们
192 | 她们
193 | 倘或
194 | 倘然
195 | 倘若
196 | 倘使
197 | 要么
198 | 要是
199 | 也罢
200 | 也好
201 | 以便
202 | 依照
203 | 以及
204 | 以免
205 | 以至
206 | 以致
207 | 抑或
208 | 因此
209 | 因而
210 | 因为
211 | 由于
212 | 有的
213 | 有关
214 | 有些
215 | 于是
216 | 与否
217 | 与其
218 | 越是
219 | 云云
220 | 一般
221 | 一旦
222 | 一来
223 | 一切
224 | 一样
225 | 同时
226 | 万一
227 | 为何
228 | 为了
229 | 为着
230 | 嗡嗡
231 | 我们
232 | 呜呼
233 | 乌乎
234 | 无论
235 | 无宁
236 | 沿着
237 | 毋宁
238 | 向着
239 | 照着
240 | 怎么
241 | 咱们
242 | 在下
243 | 再说
244 | 再者
245 | 怎样
246 | 这边
247 | 这儿
248 | 这个
249 | 这里
250 | 这么
251 | 这时
252 | 这些
253 | 这样
254 | 正如
255 | 之类
256 | 之一
257 | 只是
258 | 只限
259 | 只要
260 | 只有
261 | 至于
262 | 诸位
263 | 着呢
264 | 纵令
265 | 纵然
266 | 纵使
267 | 遵照
268 | 作为
269 | 喔唷
270 | 自从
271 | 自己
272 | 自家
273 | 自身
274 | 总之
275 | 要不
276 | 哎呀
277 | 哎哟
278 | 俺们
279 | 按照
280 | 吧哒
281 | 罢了
282 | 本着
283 | 比方
284 | 比如
285 | 鄙人
286 | 彼此
287 | 别的
288 | 别说
289 | 并且
290 | 不比
291 | 不成
292 | 不单
293 | 不但
294 | 不独
295 | 不管
296 | 不光
297 | 不过
298 | 不仅
299 | 不拘
300 | 不论
301 | 不怕
302 | 不然
303 | 不如
304 | 不特
305 | 不惟
306 | 不问
307 | 不只
308 | 朝着
309 | 趁着
310 | 除非
311 | 除了
312 | 此间
313 | 此外
314 | 从而
315 | 但是
316 | 当着
317 | 的话
318 | 等等
319 | 叮咚
320 | 对于
321 | 多少
322 | 而况
323 | 而且
324 | 而是
325 | 而外
326 | 而言
327 | 而已
328 | 尔后
329 | 反之
330 | 非但
331 | 非徒
332 | 否则
333 | 嘎登
334 | 各个
335 | 各位
336 | 各种
337 | 各自
338 | 根据
339 | 故此
340 | 固然
341 | 关于
342 | 果然
343 | 果真
344 | 哈哈
345 | 何处
346 | 何况
347 | 何时
348 | 哼唷
349 | 呼哧
350 | 还是
351 | 还有
352 | 或是
353 | 或者
354 | 极了
355 | 及其
356 | 及至
357 | 即便
358 | 即或
359 | 即令
360 | 即若
361 | 即使
362 | 既然
363 | 既是
364 | 继而
365 | 加之
366 | 假如
367 | 假若
368 | 假使
369 | 鉴于
370 | 几时
371 | 较之
372 | 接着
373 | 结果
374 | 进而
375 | 尽管
376 | 经过
377 | 就是
378 | 可见
379 | 可是
380 | 可以
381 | 况且
382 | 开始
383 | 开外
384 | 来着
385 | 例如
386 | 连同
387 | 两者
388 | 另外
389 | 慢说
390 | 漫说
391 | 每当
392 | 莫若
393 | 某个
394 | 某些
395 | 哪边
396 | 哪儿
397 | 哪个
398 | 哪里
399 | 哪年
400 | 哪怕
401 | 哪天
402 | 哪些
403 | 哪样
404 | 那边
405 | 那儿
406 | 那个
407 | 那里
408 | 那么
409 | 那时
410 | 那些
411 | 那样
412 | 乃至
413 | 宁可
414 | 宁肯
415 | 宁愿
416 | 你们
417 | 啪达
418 | 旁人
419 | 凭借
420 | 其次
421 | 其二
422 | 其他
423 | 其它
424 | 其一
425 | 其余
426 | 其中
427 | 起见
428 | 起见
429 | 岂但
430 | 前后
431 | 前者
432 | 然而
433 | 然后
434 | 然则
435 | 人家
436 | 任何
437 | 任凭
438 | 如此
439 | 如果
440 | 如何
441 | 如其
442 | 如若
443 | 若非
444 | 若是
445 | 上下
446 | 尚且
447 | 设若
448 | 设使
449 | 甚而
450 | 甚么
451 | 甚至
452 | 省得
453 | 时候
454 | 什么
455 | 使得
456 | 是的
457 | 首先
458 | 首先
459 | 其次
460 | 再次
461 | 最后
462 | 您们
463 | 它们
464 | 她们
465 | 他们
466 | 我们
467 | 你是
468 | 您是
469 | 我是
470 | 他是
471 | 她是
472 | 它是
473 | 不是
474 | 你们
475 | 啊哈
476 | 啊呀
477 | 啊哟
478 | 挨次
479 | 挨个
480 | 挨着
481 | 哎呀
482 | 哎哟
483 | 俺们
484 | 按理
485 | 按期
486 | 默然
487 | 按时
488 | 按说
489 | 按照
490 | 暗中
491 | 暗自
492 | 昂然
493 | 八成
494 | 倍感
495 | 倍加
496 | 本人
497 | 本身
498 | 本着
499 | 并非
500 | 别人
501 | 必定
502 | 比起
503 | 比如
504 | 比照
505 | 鄙人
506 | 毕竟
507 | 必将
508 | 必须
509 | 并肩
510 | 并没
511 | 并排
512 | 并且
513 | 并无
514 | 勃然
515 | 不必
516 | 不常
517 | 不大
518 | 不单
519 | 不但
520 | 而且
521 | 不得
522 | 不迭
523 | 不定
524 | 不独
525 | 不对
526 | 不妨
527 | 不管
528 | 不光
529 | 不过
530 | 不会
531 | 不仅
532 | 不拘
533 | 不力
534 | 不了
535 | 不料
536 | 不论
537 | 不满
538 | 不免
539 | 不起
540 | 不巧
541 | 不然
542 | 不日
543 | 不少
544 | 不胜
545 | 不时
546 | 不是
547 | 不同
548 | 不能
549 | 不要
550 | 不外
551 | 不下
552 | 不限
553 | 不消
554 | 不已
555 | 不再
556 | 不曾
557 | 不止
558 | 不只
559 | 才能
560 | 彻夜
561 | 趁便
562 | 趁机
563 | 趁热
564 | 趁势
565 | 趁早
566 | 趁着
567 | 成心
568 | 乘机
569 | 乘势
570 | 乘隙
571 | 乘虚
572 | 诚然
573 | 迟早
574 | 充分
575 | 出来
576 | 出去
577 | 除此
578 | 除非
579 | 除开
580 | 除了
581 | 除去
582 | 除却
583 | 除外
584 | 处处
585 | 传说
586 | 传闻
587 | 纯粹
588 | 此后
589 | 此间
590 | 此外
591 | 此中
592 | 次第
593 | 匆匆
594 | 从不
595 | 从此
596 | 从而
597 | 从宽
598 | 从来
599 | 从轻
600 | 从速
601 | 从头
602 | 从未
603 | 从小
604 | 从新
605 | 从严
606 | 从优
607 | 从中
608 | 从重
609 | 凑巧
610 | 存心
611 | 达旦
612 | 打从
613 | 大大
614 | 大抵
615 | 大都
616 | 大多
617 | 大凡
618 | 大概
619 | 大家
620 | 大举
621 | 大略
622 | 大约
623 | 大致
624 | 待到
625 | 单纯
626 | 单单
627 | 但是
628 | 但愿
629 | 当场
630 | 当儿
631 | 当即
632 | 当然
633 | 当庭
634 | 当头
635 | 当下
636 | 当真
637 | 当中
638 | 当着
639 | 倒是
640 | 到处
641 | 到底
642 | 到头
643 | 得起
644 | 的话
645 | 的确
646 | 等到
647 | 等等
648 | 顶多
649 | 动辄
650 | 陡然
651 | 独自
652 | 断然
653 | 对于
654 | 顿时
655 | 多次
656 | 多多
657 | 多亏
658 | 而后
659 | 而论
660 | 而且
661 | 而是
662 | 而外
663 | 而言
664 | 而已
665 | 而又
666 | 尔等
667 | 反倒
668 | 反而
669 | 反手
670 | 反之
671 | 方才
672 | 方能
673 | 非常
674 | 非但
675 | 非得
676 | 分头
677 | 奋勇
678 | 愤然
679 | 更为
680 | 更加
681 | 根据
682 | 个人
683 | 各式
684 | 刚才
685 | 敢情
686 | 该当
687 | 嘎嘎
688 | 否则
689 | 赶快
690 | 敢于
691 | 刚好
692 | 刚巧
693 | 高低
694 | 格外
695 | 隔日
696 | 隔夜
697 | 公然
698 | 过于
699 | 果然
700 | 果真
701 | 光是
702 | 关于
703 | 共总
704 | 姑且
705 | 故此
706 | 故而
707 | 故意
708 | 固然
709 | 惯常
710 | 毫不
711 | 毫无
712 | 很多
713 | 何须
714 | 好在
715 | 何必
716 | 何尝
717 | 何妨
718 | 何苦
719 | 何况
720 | 何止
721 | 很少
722 | 轰然
723 | 后来
724 | 呼啦
725 | 哗啦
726 | 互相
727 | 忽地
728 | 忽然
729 | 话说
730 | 或是
731 | 伙同
732 | 豁然
733 | 恍然
734 | 还是
735 | 或许
736 | 或者
737 | 基本
738 | 基于
739 | 极大
740 | 极度
741 | 极端
742 | 极力
743 | 极其
744 | 极为
745 | 即便
746 | 即将
747 | 及其
748 | 及至
749 | 即刻
750 | 即令
751 | 即使
752 | 几度
753 | 几番
754 | 几乎
755 | 几经
756 | 既然
757 | 继而
758 | 继之
759 | 加上
760 | 加以
761 | 加之
762 | 假如
763 | 假若
764 | 假使
765 | 间或
766 | 将才
767 | 简直
768 | 鉴于
769 | 将近
770 | 将要
771 | 交口
772 | 较比
773 | 较为
774 | 较之
775 | 皆可
776 | 截然
777 | 截至
778 | 藉以
779 | 借此
780 | 借以
781 | 届时
782 | 尽快
783 | 近来
784 | 进而
785 | 进来
786 | 进去
787 | 尽管
788 | 尽量
789 | 尽然
790 | 就算
791 | 居然
792 | 就此
793 | 就地
794 | 竟然
795 | 究竟
796 | 经常
797 | 尽早
798 | 精光
799 | 经过
800 | 就是
801 | 局外
802 | 举凡
803 | 据称
804 | 据此
805 | 据实
806 | 据说
807 | 可好
808 | 看来
809 | 开外
810 | 绝不
811 | 决不
812 | 据悉
813 | 决非
814 | 绝顶
815 | 绝对
816 | 绝非
817 | 可见
818 | 可能
819 | 可是
820 | 可以
821 | 恐怕
822 | 来讲
823 | 来看
824 | 快要
825 | 况且
826 | 拦腰
827 | 牢牢
828 | 老是
829 | 累次
830 | 累年
831 | 理当
832 | 理该
833 | 理应
834 | 例如
835 | 立地
836 | 立刻
837 | 立马
838 | 立时
839 | 联袂
840 | 连连
841 | 连日
842 | 路经
843 | 临到
844 | 连声
845 | 连同
846 | 连袂
847 | 另外
848 | 另行
849 | 屡次
850 | 屡屡
851 | 缕缕
852 | 率尔
853 | 率然
854 | 略加
855 | 略微
856 | 略为
857 | 论说
858 | 马上
859 | 猛然
860 | 没有
861 | 每当
862 | 每逢
863 | 每每
864 | 莫不
865 | 莫非
866 | 莫如
867 | 莫若
868 | 哪怕
869 | 那么
870 | 那末
871 | 那些
872 | 乃至
873 | 难道
874 | 难得
875 | 难怪
876 | 难说
877 | 你们
878 | 凝神
879 | 宁可
880 | 宁肯
881 | 宁愿
882 | 偶而
883 | 偶尔
884 | 碰巧
885 | 譬如
886 | 偏偏
887 | 平素
888 | 迫于
889 | 扑通
890 | 其次
891 | 其后
892 | 其实
893 | 其它
894 | 起初
895 | 起来
896 | 起首
897 | 起头
898 | 起先
899 | 岂但
900 | 岂非
901 | 岂止
902 | 恰逢
903 | 恰好
904 | 恰恰
905 | 恰巧
906 | 恰如
907 | 恰似
908 | 前后
909 | 前者
910 | 切莫
911 | 切切
912 | 切勿
913 | 亲口
914 | 亲身
915 | 亲手
916 | 亲眼
917 | 亲自
918 | 顷刻
919 | 请勿
920 | 取道
921 | 权时
922 | 全都
923 | 全力
924 | 全年
925 | 全然
926 | 然而
927 | 然后
928 | 人家
929 | 人人
930 | 仍旧
931 | 仍然
932 | 日见
933 | 日渐
934 | 日益
935 | 日臻
936 | 如常
937 | 如次
938 | 如果
939 | 如今
940 | 如期
941 | 如若
942 | 如上
943 | 如下
944 | 上来
945 | 上去
946 | 瑟瑟
947 | 沙沙
948 | 啊
949 | 哎
950 | 唉
951 | 俺
952 | 按
953 | 吧
954 | 把
955 | 甭
956 | 别
957 | 嘿
958 | 很
959 | 乎
960 | 会
961 | 或
962 | 既
963 | 及
964 | 啦
965 | 了
966 | 们
967 | 你
968 | 您
969 | 哦
970 | 砰
971 | 啊
972 | 你
973 | 我
974 | 他
975 | 她
976 | 它
977 |
--------------------------------------------------------------------------------
/源码分析/img/image-20210119174014054.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Carl-yan-bit/dataScience_term_project/11437f1e016095c728b072babebfdd7a8b7b0130/源码分析/img/image-20210119174014054.png
--------------------------------------------------------------------------------
/源码分析/img/image-20210119222637859.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Carl-yan-bit/dataScience_term_project/11437f1e016095c728b072babebfdd7a8b7b0130/源码分析/img/image-20210119222637859.png
--------------------------------------------------------------------------------
/源码分析/img/image-20210119222750738.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Carl-yan-bit/dataScience_term_project/11437f1e016095c728b072babebfdd7a8b7b0130/源码分析/img/image-20210119222750738.png
--------------------------------------------------------------------------------
/源码分析/img/image-20210119222820365.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Carl-yan-bit/dataScience_term_project/11437f1e016095c728b072babebfdd7a8b7b0130/源码分析/img/image-20210119222820365.png
--------------------------------------------------------------------------------
/源码分析/img/image-20210119223019946.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Carl-yan-bit/dataScience_term_project/11437f1e016095c728b072babebfdd7a8b7b0130/源码分析/img/image-20210119223019946.png
--------------------------------------------------------------------------------
/源码分析/img/image-20210119223044549.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Carl-yan-bit/dataScience_term_project/11437f1e016095c728b072babebfdd7a8b7b0130/源码分析/img/image-20210119223044549.png
--------------------------------------------------------------------------------
/源码分析/img/image-20210119223143176.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Carl-yan-bit/dataScience_term_project/11437f1e016095c728b072babebfdd7a8b7b0130/源码分析/img/image-20210119223143176.png
--------------------------------------------------------------------------------
/源码分析/img/image-20210119223308316.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Carl-yan-bit/dataScience_term_project/11437f1e016095c728b072babebfdd7a8b7b0130/源码分析/img/image-20210119223308316.png
--------------------------------------------------------------------------------
/源码分析/img/image-20210119223409484.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Carl-yan-bit/dataScience_term_project/11437f1e016095c728b072babebfdd7a8b7b0130/源码分析/img/image-20210119223409484.png
--------------------------------------------------------------------------------
/源码分析/img/image-20210119223432546.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Carl-yan-bit/dataScience_term_project/11437f1e016095c728b072babebfdd7a8b7b0130/源码分析/img/image-20210119223432546.png
--------------------------------------------------------------------------------
/源码分析/img/image-20210119223712935.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Carl-yan-bit/dataScience_term_project/11437f1e016095c728b072babebfdd7a8b7b0130/源码分析/img/image-20210119223712935.png
--------------------------------------------------------------------------------
/源码分析/img/image-20210119223728526.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Carl-yan-bit/dataScience_term_project/11437f1e016095c728b072babebfdd7a8b7b0130/源码分析/img/image-20210119223728526.png
--------------------------------------------------------------------------------
/源码分析/数据科学大作业-源码分析.md:
--------------------------------------------------------------------------------
1 | # 数据科学大作业-源码分析
2 |
3 | ## 1. dataSets
4 |
5 | 存放爬取数据
6 |
7 | ### 1.1 bilibili
8 |
9 | 1. **json文件**
10 |
11 | 1. 原始爬取数据,部分b站up主,文件格式 .json
12 | 2. 示例:
13 |
14 | 2. **样本**:处理后的数据
15 |
16 | 1. 机器学习的训练集、提取出的弹幕的csv文件和预测情感后的csv文件等
17 |
18 | 
19 |
20 | ### 1.2 sina
21 |
22 | 存放新浪数据集
23 |
24 | 1. **样本**:机器学习的训练集、提取出的弹幕的csv文件和预测情感后的csv文件等
25 |
26 | 
27 |
28 | 2. **原始爬取数据:**
29 |
30 | 3. **word2vec模型语料库**:
31 |
32 | 4. **使用机器学习模型预测情感后的数据**:
33 |
34 | ## 2. model
35 |
36 | ### 2.1 情感分析机器学习模型
37 |
38 | 
39 |
40 | ### 2.2 word2vec模型
41 |
42 | 
43 |
44 | ## 3. scripts
45 |
46 | > 代码
47 |
48 | ### 3.1 crawler (爬虫代码)
49 |
50 | 
51 |
52 | 1. **bilibili_crawler**
53 | 1. 作用:爬取b站数据
54 | 2. 解析:源码中有注释
55 | 2. **sina_crawler**
56 | 1. 作用:爬取新浪新闻正文、评论等信息
57 | 2. 解析:源码中有注释
58 |
59 | ### 3.2 data_process(数据分析代码)
60 |
61 | 1. **data_filter**
62 | 1. 作用:数据过滤,筛选出符合要求的数据
63 | 2. 解析:源码中有注释
64 | 2. **nlp_test**
65 | 1. 作用:使用Hanlp, snownlp等已有模型进行情感预测,测试准确率
66 | 2. 结论:准确率在**50% - 60%**左右
67 | 3. **nlp**
68 | 1. 作用:训练情感分析机器学习模型与word2vec模型
69 | 2. 解析:源码中有注释
70 | 3. 最终训练模型:训练集准确率在**99%**以上,测试集准确率在 **85%**左右
71 |
72 | ## 4. stopwords (停用词表)
73 |
74 | 来源:https://github.com/goto456/stopwords
75 |
76 | ## 5. normal (高斯分布)
77 |
78 | data.json:原始新闻数据
79 |
80 | num.json:点击数数据
81 |
82 | result.json:热点新闻数据
83 |
84 | article.py:生成热点新闻数据
85 |
86 | curvefit.py:拟合曲线
87 |
88 | ## 6. charts(可视化)
89 |
90 | ### 数据可视化
91 |
92 | ### 1.词云
93 |
94 | 基于WordCloud库实现。从已经获得并经过前期处理的新闻集中读取所有新闻并将其按新闻日期重新排列。再按每一天查找已经分析得到的新闻关键词。输入WordCloud提供的API,得到词云
95 |
96 | #### 读取新闻并重排列
97 |
98 | ```python
99 | import json
100 | def load_files(path):
101 | with open(path, 'r') as f:
102 | return json.load(f)
103 |
104 |
105 | def arrange(news):
106 | #news是传入的load完的json文件
107 | daily = dict()
108 | monthly = dict()
109 | news_list = {"daily": daily, "monthly": monthly} #提供按天和按月两种查看方式
110 | for year in range(2019, 2021):
111 | for month in range(1, 13):
112 | mon = tostr(year) + "-" + tostr(month)
113 | monLst = []
114 | for day in range(1, 32):
115 | date = tostr(year) + "-" + tostr(month) + "-" + tostr(day)
116 | lst = []
117 | for new in news:
118 | if new["create_date"] == date: #如果和新闻的日期相同,就把新闻加入列表
119 | lst.append(new)
120 | monLst.append(new)
121 | if len(lst) != 0:
122 | #如果列表为空,就不加入字典了
123 | daily[date] = lst
124 | if len(monLst) != 0:
125 | monthly[mon] = monLst
126 | #返回一个字典,key值为"daily"、"monthly",分别对应按日、按月重排列结果的日期为key值的字典.
127 | return news_list
128 | ```
129 |
130 | #### 调用WordCloud库
131 |
132 | ```python
133 | def draw(keywords, date, mas):
134 | text = " ".join(keywords) #把关键词排成一段话
135 | try:
136 | text = text.replace("新浪", "")
137 | text = text.replace("新闻", "")
138 | #简易的过滤,去掉新浪新闻
139 | except:
140 | pass
141 | cloud = WordCloud(
142 | background_color='white',
143 | # 设置背景宽
144 | width=1920,
145 | font_path="HGKT_CNKI.TTF",
146 | # 设置背景高
147 | height=1080,
148 | mode='RGBA',
149 | mask=mas
150 | )
151 | word_cloud = cloud.generate(text)
152 | word_cloud.to_file("picture/" + date + ".png")
153 | ```
154 |
155 | #### 样图
156 |
157 | 
158 |
159 | ### 2.新浪新闻及评论、B站弹幕统计图表
160 |
161 | 基于Pyecharts库实现。通过对数据集先分主题、再分时间,实现精细化划分评论。此时可以统计评论、新闻数量。再根据已经预测好的情感,和可以获取的点赞数实现加权、不加权的情感平均
162 |
163 | #### 按主题和按时间分类
164 |
165 | ```python
166 | def arrangeByTime(news):
167 | #类似上文arrange,不做赘述
168 | daily = dict()
169 | monthly = dict()
170 | days = dict()
171 | news_list = {"daily": daily, "monthly": monthly, "days": days}
172 | times = 0
173 | day3 = []
174 | for year in range(2019, 2021):
175 | for month in range(1, 13):
176 | mon = tostr(year) + "-" + tostr(month)
177 | monLst = []
178 | for day in range(1, 32):
179 | date = tostr(year) + "-" + tostr(month) + "-" + tostr(day)
180 | lst = []
181 | for new in news:
182 | if new["create_date"] == date:
183 | lst.append(new)
184 | monLst.append(new)
185 | day3.append(new)
186 | times += 1
187 | if times == 3:
188 | if len(day3) != 0:
189 | days[date] = day3
190 | day3 = []
191 | times = 0
192 | if len(lst) != 0:
193 | daily[date] = lst
194 | if len(monLst) != 0:
195 | monthly[mon] = monLst
196 | return news_list
197 |
198 | def arrangeByChannel(news):
199 | channel = dict()
200 | for new in news:
201 | if new['channel'] not in channel.keys():
202 | channel[new['channel']] = []
203 | #不存在则新建,存在则加入
204 | channel[new['channel']].append(new)
205 | else:
206 | channel[new['channel']].append(new)
207 | return channel
208 | ```
209 |
210 |
211 |
212 | #### 数目统计-以新闻数量为例
213 |
214 | ```python
215 | def drawDailyNewsNum(news, mode):
216 | line = Line()
217 | line.add_xaxis(list(news.get(mode).keys()))
218 | y = []
219 | for i in news.get(mode).keys():
220 | y.append(len(news.get(mode).get(i)))
221 | #用字典value的长度来确定新闻数
222 | line.add_yaxis("新闻数量", y_axis=y)
223 | line.set_global_opts(title_opts=options.TitleOpts(title=titleTransform("新浪新闻" + str(mode) + "数量"), pos_top='55'))
224 | return line
225 | ```
226 |
227 | #### 情感平均-以新闻评论为例
228 |
229 | ```python
230 | def sina_comment(data, mode, time):
231 | #data是数据,mode是确定加不加权,time指定按天\月\12天绘图
232 | line = Line()
233 | temp = list(arrangeByTime(data).get(time).keys())
234 | line.add_xaxis(temp)
235 | data = arrangeByChannel(data) # 按频道分
236 | news = dict()
237 | for i in data.keys():
238 | news[i] = arrangeByTime(data.get(i)).get(time)
239 | #频道分完后再按时间分
240 | value = dict()
241 | comment_channel = dict()
242 | for i in news.keys():
243 | comment_channel[i] = dict()
244 | value[i] = dict()
245 | for j in news[i].keys():
246 | comment_channel[i][j] = divideComment(news[i].get(j))
247 | #按维度和时间梳理评论
248 | value[i] = getMood(comment_channel[i], mode)
249 | #获取评论对应的平均心态值
250 | for i in value.keys():
251 | y = []
252 | for j in temp:
253 | if j in value.get(i).keys():
254 | y.append(value.get(i).get(j))
255 | else:
256 | y.append(None)
257 | #可能存在当天没有频道新闻
258 | if i not in ['js', 'jilin', 'video', 'live']:
259 | #数据过少,舍弃
260 | line.add_yaxis(tran(i), y, is_connect_nones=True, is_symbol_show=(time == 'monthly'))
261 | line.set_global_opts(title_opts=options.TitleOpts(title=titleTransform("新浪新闻评论"+str(mode) + str(time) + "评论情感分析"), pos_top='55'))
262 | return line
263 |
264 |
265 | def getMood(comments, mode):
266 | #简简单单取平均,mode是确定加不加权
267 | mood = dict()
268 | for i in comments.keys():
269 | sum = 0
270 | times = 0
271 | if len(comments.get(i)) == 0:
272 | continue
273 | for j in comments.get(i):
274 | if mode == 0:
275 | temp = str(j['sentiment'])
276 | if not temp.__contains__("."):
277 | #规避可能的不是指定格式的错误
278 | continue
279 | times += 1
280 | sum += float(temp)
281 | else:
282 | temp = str(j['sentiment'])
283 | if not temp.__contains__("."):
284 | #规避可能的不是指定格式的错误
285 | continue
286 | agree = str(j['agree'])
287 | if not agree.isdigit():
288 | continue
289 | times += max(int(agree), 1)
290 | sum += float(temp) * max(int(agree), 1)
291 | mood[i] = str.format("{:.3f}", sum / times)
292 | return mood
293 | ```
294 |
295 | #### 示例
296 |
297 | [示例页面](https://www.rubisco.cn/picturebed/chart.html)
298 |
299 |
300 |
301 |
--------------------------------------------------------------------------------