jkdamilola commited on
Commit
1ef5f93
·
verified ·
1 Parent(s): 17f8a8e

Add BERTopic model

Browse files
Files changed (4) hide show
  1. README.md +75 -0
  2. config.json +16 -0
  3. topic_embeddings.safetensors +3 -0
  4. topics.json +483 -0
README.md ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+ tags:
4
+ - bertopic
5
+ library_name: bertopic
6
+ pipeline_tag: text-classification
7
+ ---
8
+
9
+ # rag-topic-model
10
+
11
+ This is a [BERTopic](https://github.com/MaartenGr/BERTopic) model.
12
+ BERTopic is a flexible and modular topic modeling framework that allows for the generation of easily interpretable topics from large datasets.
13
+
14
+ ## Usage
15
+
16
+ To use this model, please install BERTopic:
17
+
18
+ ```
19
+ pip install -U bertopic
20
+ ```
21
+
22
+ You can use the model as follows:
23
+
24
+ ```python
25
+ from bertopic import BERTopic
26
+ topic_model = BERTopic.load("jkdamilola/rag-topic-model")
27
+
28
+ topic_model.get_topic_info()
29
+ ```
30
+
31
+ ## Topic overview
32
+
33
+ * Number of topics: 6
34
+ * Number of training documents: 168
35
+
36
+ <details>
37
+ <summary>Click here for an overview of all topics.</summary>
38
+
39
+ | Topic ID | Topic Keywords | Topic Frequency | Label |
40
+ |----------|----------------|-----------------|-------|
41
+ | -1 | to - klarna - for - my - the | 10 | -1_to_klarna_for_my |
42
+ | 0 | klarna - declined - my - in - ive | 63 | 0_klarna_declined_my_in |
43
+ | 1 | payment - the - to - for - pay | 33 | 1_payment_the_to_for |
44
+ | 2 | my - details - klarna - and - call | 27 | 2_my_details_klarna_and |
45
+ | 3 | store - refund - back - the - credit | 23 | 3_store_refund_back_the |
46
+ | 4 | the - shoes - ago - havent - sneakers | 12 | 4_the_shoes_ago_havent |
47
+
48
+ </details>
49
+
50
+ ## Training hyperparameters
51
+
52
+ * calculate_probabilities: False
53
+ * language: None
54
+ * low_memory: False
55
+ * min_topic_size: 10
56
+ * n_gram_range: (1, 1)
57
+ * nr_topics: auto
58
+ * seed_topic_list: None
59
+ * top_n_words: 10
60
+ * verbose: False
61
+ * zeroshot_min_similarity: 0.7
62
+ * zeroshot_topic_list: None
63
+
64
+ ## Framework versions
65
+
66
+ * Numpy: 1.26.4
67
+ * HDBSCAN: 0.8.40
68
+ * UMAP: 0.5.7
69
+ * Pandas: 2.2.3
70
+ * Scikit-Learn: 1.6.1
71
+ * Sentence-transformers: 3.1.1
72
+ * Transformers: 4.42.2
73
+ * Numba: 0.60.0
74
+ * Plotly: 6.1.2
75
+ * Python: 3.9.6
config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "calculate_probabilities": false,
3
+ "language": null,
4
+ "low_memory": false,
5
+ "min_topic_size": 10,
6
+ "n_gram_range": [
7
+ 1,
8
+ 1
9
+ ],
10
+ "nr_topics": "auto",
11
+ "seed_topic_list": null,
12
+ "top_n_words": 10,
13
+ "verbose": false,
14
+ "zeroshot_min_similarity": 0.7,
15
+ "zeroshot_topic_list": null
16
+ }
topic_embeddings.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b52df5bed2195076aa8788f3b2f561e86fc34d10cce6e44b05df8bd85bba22b
3
+ size 9304
topics.json ADDED
@@ -0,0 +1,483 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "topic_representations": {
3
+ "-1": [
4
+ [
5
+ "to",
6
+ 0.06366634056582052
7
+ ],
8
+ [
9
+ "klarna",
10
+ 0.058563426524662565
11
+ ],
12
+ [
13
+ "for",
14
+ 0.05708016740383908
15
+ ],
16
+ [
17
+ "my",
18
+ 0.0540535586409528
19
+ ],
20
+ [
21
+ "the",
22
+ 0.04988948664228271
23
+ ],
24
+ [
25
+ "but",
26
+ 0.044876771720143996
27
+ ],
28
+ [
29
+ "this",
30
+ 0.04366555811224569
31
+ ],
32
+ [
33
+ "card",
34
+ 0.042434634361117
35
+ ],
36
+ [
37
+ "payment",
38
+ 0.03968910968001575
39
+ ],
40
+ [
41
+ "is",
42
+ 0.038921410800726836
43
+ ]
44
+ ],
45
+ "0": [
46
+ [
47
+ "klarna",
48
+ 0.07449586279845444
49
+ ],
50
+ [
51
+ "declined",
52
+ 0.06795795177907002
53
+ ],
54
+ [
55
+ "my",
56
+ 0.06705259331822376
57
+ ],
58
+ [
59
+ "in",
60
+ 0.0611866123227055
61
+ ],
62
+ [
63
+ "ive",
64
+ 0.05663866886753325
65
+ ],
66
+ [
67
+ "for",
68
+ 0.055955306176357376
69
+ ],
70
+ [
71
+ "was",
72
+ 0.04737667958727395
73
+ ],
74
+ [
75
+ "used",
76
+ 0.043969660760076835
77
+ ],
78
+ [
79
+ "payment",
80
+ 0.0405082565753364
81
+ ],
82
+ [
83
+ "before",
84
+ 0.03961289908787577
85
+ ]
86
+ ],
87
+ "1": [
88
+ [
89
+ "payment",
90
+ 0.08328110789640457
91
+ ],
92
+ [
93
+ "the",
94
+ 0.07995688579453282
95
+ ],
96
+ [
97
+ "to",
98
+ 0.07669251135478128
99
+ ],
100
+ [
101
+ "for",
102
+ 0.0692706554172218
103
+ ],
104
+ [
105
+ "pay",
106
+ 0.06573790785925522
107
+ ],
108
+ [
109
+ "my",
110
+ 0.0577062124978064
111
+ ],
112
+ [
113
+ "due",
114
+ 0.05249883650630263
115
+ ],
116
+ [
117
+ "card",
118
+ 0.0460478569965555
119
+ ],
120
+ [
121
+ "bought",
122
+ 0.04577471628765139
123
+ ],
124
+ [
125
+ "of",
126
+ 0.04521429008125425
127
+ ]
128
+ ],
129
+ "2": [
130
+ [
131
+ "my",
132
+ 0.10165728926906413
133
+ ],
134
+ [
135
+ "details",
136
+ 0.07901394868221154
137
+ ],
138
+ [
139
+ "klarna",
140
+ 0.06967721403670435
141
+ ],
142
+ [
143
+ "and",
144
+ 0.0685333462591036
145
+ ],
146
+ [
147
+ "call",
148
+ 0.05870520531068303
149
+ ],
150
+ [
151
+ "account",
152
+ 0.055683914274869524
153
+ ],
154
+ [
155
+ "someone",
156
+ 0.05193147948287793
157
+ ],
158
+ [
159
+ "worried",
160
+ 0.05028160370686189
161
+ ],
162
+ [
163
+ "email",
164
+ 0.04659585878168645
165
+ ],
166
+ [
167
+ "to",
168
+ 0.0449920124439751
169
+ ]
170
+ ],
171
+ "3": [
172
+ [
173
+ "store",
174
+ 0.08744239863150534
175
+ ],
176
+ [
177
+ "refund",
178
+ 0.08035878276840205
179
+ ],
180
+ [
181
+ "back",
182
+ 0.08035878276840205
183
+ ],
184
+ [
185
+ "the",
186
+ 0.07540957475408547
187
+ ],
188
+ [
189
+ "credit",
190
+ 0.06995391890520428
191
+ ],
192
+ [
193
+ "it",
194
+ 0.06304408330439346
195
+ ],
196
+ [
197
+ "ago",
198
+ 0.061326316218940496
199
+ ],
200
+ [
201
+ "and",
202
+ 0.059792335410611845
203
+ ],
204
+ [
205
+ "days",
206
+ 0.05975069379286096
207
+ ],
208
+ [
209
+ "my",
210
+ 0.05644005898504077
211
+ ]
212
+ ],
213
+ "4": [
214
+ [
215
+ "the",
216
+ 0.1034242317752282
217
+ ],
218
+ [
219
+ "shoes",
220
+ 0.08174352145486977
221
+ ],
222
+ [
223
+ "ago",
224
+ 0.08051463916033343
225
+ ],
226
+ [
227
+ "havent",
228
+ 0.07423314580328677
229
+ ],
230
+ [
231
+ "sneakers",
232
+ 0.0738013844449905
233
+ ],
234
+ [
235
+ "days",
236
+ 0.06723944741489953
237
+ ],
238
+ [
239
+ "and",
240
+ 0.06422783956470815
241
+ ],
242
+ [
243
+ "arrived",
244
+ 0.06127134568680696
245
+ ],
246
+ [
247
+ "ordered",
248
+ 0.05904110755599241
249
+ ],
250
+ [
251
+ "received",
252
+ 0.055674859352465085
253
+ ]
254
+ ]
255
+ },
256
+ "topics": [
257
+ 2,
258
+ 3,
259
+ 0,
260
+ 2,
261
+ -1,
262
+ 3,
263
+ 1,
264
+ -1,
265
+ -1,
266
+ -1,
267
+ -1,
268
+ -1,
269
+ 1,
270
+ -1,
271
+ -1,
272
+ -1,
273
+ -1,
274
+ -1,
275
+ 0,
276
+ -1,
277
+ 3,
278
+ -1,
279
+ -1,
280
+ -1,
281
+ 1,
282
+ -1,
283
+ -1,
284
+ 1,
285
+ 0,
286
+ 1,
287
+ 1,
288
+ 1,
289
+ -1,
290
+ -1,
291
+ 1,
292
+ 3,
293
+ 3,
294
+ 3,
295
+ 3,
296
+ 0,
297
+ -1,
298
+ 4,
299
+ -1,
300
+ 1,
301
+ 3,
302
+ -1,
303
+ -1,
304
+ -1,
305
+ 1,
306
+ 4,
307
+ 1,
308
+ 1,
309
+ -1,
310
+ -1,
311
+ -1,
312
+ -1,
313
+ 2,
314
+ -1,
315
+ 2,
316
+ 1,
317
+ -1,
318
+ 2,
319
+ 0,
320
+ -1,
321
+ 4,
322
+ 2,
323
+ -1,
324
+ -1,
325
+ 2,
326
+ 2,
327
+ 2,
328
+ 2,
329
+ 2,
330
+ 2,
331
+ 2,
332
+ 2,
333
+ -1,
334
+ 2,
335
+ 2,
336
+ 2,
337
+ -1,
338
+ 2,
339
+ 2,
340
+ 2,
341
+ 2,
342
+ 0,
343
+ 2,
344
+ 2,
345
+ -1,
346
+ -1,
347
+ -1,
348
+ -1,
349
+ 4,
350
+ -1,
351
+ 4,
352
+ -1,
353
+ 3,
354
+ 3,
355
+ 4,
356
+ 3,
357
+ -1,
358
+ -1,
359
+ 3,
360
+ -1,
361
+ 4,
362
+ 4,
363
+ -1,
364
+ 1,
365
+ 1,
366
+ 1,
367
+ 1,
368
+ -1,
369
+ 1,
370
+ 0,
371
+ 0,
372
+ 0,
373
+ 0,
374
+ 0,
375
+ 0,
376
+ 0,
377
+ 0,
378
+ 0,
379
+ -1,
380
+ 0,
381
+ -1,
382
+ 4,
383
+ 4,
384
+ 0,
385
+ 0,
386
+ 0,
387
+ 0,
388
+ 0,
389
+ 0,
390
+ -1,
391
+ 0,
392
+ 0,
393
+ -1,
394
+ 0,
395
+ -1,
396
+ 0,
397
+ -1,
398
+ 0,
399
+ -1,
400
+ 0,
401
+ 0,
402
+ 0,
403
+ 0,
404
+ 0,
405
+ -1,
406
+ 1,
407
+ 1,
408
+ 0,
409
+ -1,
410
+ -1,
411
+ -1,
412
+ -1,
413
+ -1,
414
+ 1,
415
+ -1,
416
+ -1,
417
+ 1,
418
+ 1,
419
+ 1,
420
+ 1,
421
+ 1,
422
+ -1,
423
+ -1,
424
+ 1
425
+ ],
426
+ "topic_sizes": {
427
+ "2": 23,
428
+ "3": 12,
429
+ "0": 33,
430
+ "-1": 63,
431
+ "1": 27,
432
+ "4": 10
433
+ },
434
+ "topic_mapper": [
435
+ [
436
+ -1,
437
+ -1,
438
+ -1,
439
+ -1
440
+ ],
441
+ [
442
+ 0,
443
+ 0,
444
+ 0,
445
+ 2
446
+ ],
447
+ [
448
+ 1,
449
+ 1,
450
+ 1,
451
+ 3
452
+ ],
453
+ [
454
+ 2,
455
+ 2,
456
+ 2,
457
+ 1
458
+ ],
459
+ [
460
+ 3,
461
+ 3,
462
+ 3,
463
+ 4
464
+ ],
465
+ [
466
+ 4,
467
+ 4,
468
+ 4,
469
+ 0
470
+ ]
471
+ ],
472
+ "topic_labels": {
473
+ "-1": "-1_to_klarna_for_my",
474
+ "0": "0_klarna_declined_my_in",
475
+ "1": "1_payment_the_to_for",
476
+ "2": "2_my_details_klarna_and",
477
+ "3": "3_store_refund_back_the",
478
+ "4": "4_the_shoes_ago_havent"
479
+ },
480
+ "custom_labels": null,
481
+ "_outliers": 1,
482
+ "topic_aspects": {}
483
+ }