質問編集履歴
1
質問にerrerメッセージ全文を追記。
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,54 @@
|
|
1
1
|
自然言語処理データセットfetch_20newsgroupsから学習させたモデルをpickle保存した。pickle loadして文章を学習に基づいて分類させようとしたが、Vocabulary not fitted or providedというエラー発生。
|
2
|
+
|
3
|
+
以下エラーメッセージ全行です。
|
4
|
+
|
5
|
+
Traceback (most recent call last):
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
File "<ipython-input-2-694698f5959c>", line 1, in <module>
|
10
|
+
|
11
|
+
runfile('C:/pyfile3/AI_nlp_categories3.py', wdir='C:/pyfile3')
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
File "C:\Users\BDS001\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
|
16
|
+
|
17
|
+
execfile(filename, namespace)
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
File "C:\Users\BDS001\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
|
22
|
+
|
23
|
+
exec(compile(f.read(), filename, 'exec'), namespace)
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
File "C:/pyfile3/AI_nlp_categories3.py", line 28, in <module>
|
28
|
+
|
29
|
+
nlpcat.model_run(input_data)
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
File "C:/pyfile3/AI_nlp_categories3.py", line 13, in model_run
|
34
|
+
|
35
|
+
input_tc=count_vectorizer.transform(data)
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
File "C:\Users\BDS001\Anaconda3\lib\site-packages\sklearn\feature_extraction\text.py", line 1267, in transform
|
40
|
+
|
41
|
+
self._check_vocabulary()
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
File "C:\Users\BDS001\Anaconda3\lib\site-packages\sklearn\feature_extraction\text.py", line 490, in _check_vocabulary
|
46
|
+
|
47
|
+
raise NotFittedError("Vocabulary not fitted or provided")
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
NotFittedError: Vocabulary not fitted or provided
|
2
52
|
|
3
53
|
```python3
|
4
54
|
|