質問編集履歴

1

ソースコードの修正

2018/02/01 06:23

投稿

grx72expo
grx72expo

スコア15

test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,8 @@
1
+ LDAを実行したいのですが
2
+
1
- LDAを実行したいですが、cannot compute lda over an empty collection (no terms)とエラーが表示されます。何が原因か教えてください。
3
+ 以下のエラーが表示されます。何が原因か教えてください。
4
+
5
+ ![イメージ説明](71349b72cc058cb5cf203b2083284642.jpeg)
2
6
 
3
7
 
4
8
 
@@ -6,7 +10,9 @@
6
10
 
7
11
 
8
12
 
9
- ソースコードは以下の通りです。
13
+ ソースコードは以下の通りです(LDA.py)
14
+
15
+ ```python
10
16
 
11
17
  import os
12
18
 
@@ -44,6 +50,8 @@
44
50
 
45
51
 
46
52
 
53
+
54
+
47
55
  if len(line)<30:
48
56
 
49
57
  continue
@@ -62,6 +70,8 @@
62
70
 
63
71
 
64
72
 
73
+
74
+
65
75
  wvs += [word_vector]
66
76
 
67
77
 
@@ -71,6 +81,8 @@
71
81
  dictionary.filter_extremes(no_below=2, no_above=0.3)
72
82
 
73
83
  dictionary.save_as_text('dict.txt')
84
+
85
+
74
86
 
75
87
 
76
88
 
@@ -100,6 +112,8 @@
100
112
 
101
113
  print('TOPIC:', i, '__', lda.print_topic(i))
102
114
 
115
+ ```
116
+
103
117
 
104
118
 
105
119
  環境はwindows10,ubuntu16.04です。