Script fix

This commit is contained in:
Jakub Kolasiński 2021-04-13 20:59:56 +02:00
parent 60b2708888
commit 89a269ccda
2 changed files with 80 additions and 80 deletions

View File

@ -24,7 +24,7 @@ for sentence in sentences:
spl = [x.lower() for x in spl] spl = [x.lower() for x in spl]
splited.append(spl) splited.append(spl)
documents = [TaggedDocument(doc, [i]) for i, doc in enumerate(splited)] documents = [TaggedDocument(doc, [i]) for i, doc in enumerate(splited)]
model = Doc2Vec(documents, min_count=0, alpha=0.025, epochs=20) model = Doc2Vec(documents, min_count=0, alpha=0.025, epochs=400)
# for epoch in range(10): # for epoch in range(10):
# print('Training epoch %s', epoch) # print('Training epoch %s', epoch)
# model.train() # model.train()
@ -34,7 +34,7 @@ model = Doc2Vec(documents, min_count=0, alpha=0.025, epochs=20)
X = model.dv.vectors X = model.dv.vectors
kmeans = KMeans(n_clusters=clusters_no, max_iter=1000).fit(X) kmeans = KMeans(n_clusters=clusters_no, max_iter=4000).fit(X)
labels = kmeans.labels_ labels = kmeans.labels_
centroids = kmeans.cluster_centers_ centroids = kmeans.cluster_centers_

View File

@ -1,87 +1,87 @@
9
2
8
5
0
2
2
6
1
5 5
2 2
8
0
8
8
8
8
8
2
0
8
8
2
2
2
4
9
2
7
8
9
7
2
5
8
7
2
8
9
8
7
5
8
2
7
2
8
0
1
2
0
5
7
8
7
7
7
6
2
8
7
2
2
2
7
8
7
8
8
2
8
2
0
0
9
3 3
6 3
4
4
5
7 7
4
3
3
4
1
3
3
3
3
3
3
2 2
3
3
3
3
5
4
4
3
4
3
9
5
5
3
3
5
3
3
4
3
4
3
5
5
3
3
5
1
6 6
5 5
4 1
3
5 5
7 3
4 3
3
1
0
5 5
9 3
5
3
5
3
4
3
5
3
3
5
3
3
5
2
5
2
1
3
5
1
3
4
3
2
4
3
8

1 9 5
9
2
8
5
0
2
2
6
1
1 5 5
2 2 2
8
0
8
8
8
8
8
2
0
8
8
2
2
2
4
9
2
7
8
9
7
2
5
8
7
2
8
9
8
7
5
8
2
7
2
8
0
1
2
0
5
7
8
7
7
7
6
2
8
7
2
2
2
7
8
7
8
8
2
8
2
0
0
9
3 3 3
4 6 3
5 4
6 4
7 5
8 7 7
9 4
10 3
11 3
12 4
13 1
14 3
15 3
16 3
17 3
18 3
19 3
20 2 2
21 3
22 3
23 3
24 3
25 5
26 4
27 4
28 3
29 4
30 3
31 9
32 5
33 5
34 3
35 3
36 5
37 3
38 3
39 4
40 3
41 4
42 3
43 5
44 5
45 3
46 3
47 5
48 1
49 6 6
50 5 5
51 4 1
52 3
53 5 5
54 7 3
55 4 3
56 3
57 1
58 0
59 5 5
60 9 3
61 5
62 3
63 5
64 3
65 4
66 3
67 5
68 3
69 3
70 5
71 3
72 3
73 5
74 2
75 5
76 2
77 1
78 3
79 5
80 1
81 3
82 4
83 3
84 2
85 4
86 3
87 8