質問編集履歴
1
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -24,20 +24,6 @@
|
|
24
24
|
from sklearn.naive_bayes import MultinomialNB
|
25
25
|
from sklearn.ensemble import RandomForestClassifier
|
26
26
|
import random
|
27
|
-
def load_livedoor_news_corpus():
|
28
|
-
category = {
|
29
|
-
'dokujo-tsushin': 1,
|
30
|
-
'it-life-hack':2,
|
31
|
-
'kaden-channel': 3,
|
32
|
-
'livedoor-homme': 4,
|
33
|
-
'movie-enter': 5,
|
34
|
-
'peachy': 6,
|
35
|
-
'smax': 7,
|
36
|
-
'sports-watch': 8,
|
37
|
-
'topic-news':9
|
38
|
-
}
|
39
|
-
docs = []
|
40
|
-
labels = []
|
41
27
|
|
42
28
|
for c_name, c_id in category.items():
|
43
29
|
files = glob.glob("./text/{c_name}/{c_name}*.txt".format(c_name=c_name))
|