apostolosfilippas commited on
Commit
42fbd7e
·
verified ·
1 Parent(s): 9c045f4

Add BERTopic model

Browse files
Files changed (4) hide show
  1. README.md +74 -0
  2. config.json +16 -0
  3. topic_embeddings.safetensors +3 -0
  4. topics.json +433 -0
README.md ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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("apostolosfilippas/rag-topic-model")
27
+
28
+ topic_model.get_topic_info()
29
+ ```
30
+
31
+ ## Topic overview
32
+
33
+ * Number of topics: 5
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 | for - klarna - to - my - the | 15 | -1_for_klarna_to_my |
42
+ | 0 | klarna - my - declined - for - ve | 51 | 0_klarna_my_declined_for |
43
+ | 1 | payment - to - the - my - for | 50 | 1_payment_to_the_my |
44
+ | 2 | my - klarna - and - details - account | 28 | 2_my_klarna_and_details |
45
+ | 3 | store - the - it - refund - back | 24 | 3_store_the_it_refund |
46
+
47
+ </details>
48
+
49
+ ## Training hyperparameters
50
+
51
+ * calculate_probabilities: False
52
+ * language: None
53
+ * low_memory: False
54
+ * min_topic_size: 10
55
+ * n_gram_range: (1, 1)
56
+ * nr_topics: auto
57
+ * seed_topic_list: None
58
+ * top_n_words: 10
59
+ * verbose: False
60
+ * zeroshot_min_similarity: 0.7
61
+ * zeroshot_topic_list: None
62
+
63
+ ## Framework versions
64
+
65
+ * Numpy: 1.26.4
66
+ * HDBSCAN: 0.8.40
67
+ * UMAP: 0.5.7
68
+ * Pandas: 2.2.3
69
+ * Scikit-Learn: 1.6.1
70
+ * Sentence-transformers: 3.4.1
71
+ * Transformers: 4.50.1
72
+ * Numba: 0.61.2
73
+ * Plotly: 6.0.1
74
+ * Python: 3.11.7
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:03b618de1995888187647d51b92bf5264397d9940827813be2bcad17dd3bc68c
3
+ size 7768
topics.json ADDED
@@ -0,0 +1,433 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "topic_representations": {
3
+ "-1": [
4
+ [
5
+ "for",
6
+ 0.06602511651625986
7
+ ],
8
+ [
9
+ "klarna",
10
+ 0.06438953438618288
11
+ ],
12
+ [
13
+ "to",
14
+ 0.0588484734166664
15
+ ],
16
+ [
17
+ "my",
18
+ 0.0574797691276483
19
+ ],
20
+ [
21
+ "the",
22
+ 0.05650736581105164
23
+ ],
24
+ [
25
+ "but",
26
+ 0.050391580561394415
27
+ ],
28
+ [
29
+ "payment",
30
+ 0.04423445960277377
31
+ ],
32
+ [
33
+ "card",
34
+ 0.04413108718210577
35
+ ],
36
+ [
37
+ "using",
38
+ 0.04281002577647979
39
+ ],
40
+ [
41
+ "just",
42
+ 0.039667471149400856
43
+ ]
44
+ ],
45
+ "0": [
46
+ [
47
+ "klarna",
48
+ 0.0684502885090884
49
+ ],
50
+ [
51
+ "my",
52
+ 0.06587602342538006
53
+ ],
54
+ [
55
+ "declined",
56
+ 0.06268185270099286
57
+ ],
58
+ [
59
+ "for",
60
+ 0.05184770062228036
61
+ ],
62
+ [
63
+ "ve",
64
+ 0.0514886647186727
65
+ ],
66
+ [
67
+ "the",
68
+ 0.050923634011540604
69
+ ],
70
+ [
71
+ "in",
72
+ 0.05051278288225979
73
+ ],
74
+ [
75
+ "with",
76
+ 0.04270783667311336
77
+ ],
78
+ [
79
+ "what",
80
+ 0.040295476736352545
81
+ ],
82
+ [
83
+ "to",
84
+ 0.039236097768212165
85
+ ]
86
+ ],
87
+ "1": [
88
+ [
89
+ "payment",
90
+ 0.09882734039896089
91
+ ],
92
+ [
93
+ "to",
94
+ 0.09353077326027964
95
+ ],
96
+ [
97
+ "the",
98
+ 0.08362522226811411
99
+ ],
100
+ [
101
+ "my",
102
+ 0.07677260183954467
103
+ ],
104
+ [
105
+ "for",
106
+ 0.0694800029933506
107
+ ],
108
+ [
109
+ "due",
110
+ 0.06434756124704745
111
+ ],
112
+ [
113
+ "is",
114
+ 0.060984550473916356
115
+ ],
116
+ [
117
+ "pay",
118
+ 0.05410201464634094
119
+ ],
120
+ [
121
+ "bought",
122
+ 0.05257795446732636
123
+ ],
124
+ [
125
+ "card",
126
+ 0.048551252035772596
127
+ ]
128
+ ],
129
+ "2": [
130
+ [
131
+ "my",
132
+ 0.10820482052156193
133
+ ],
134
+ [
135
+ "klarna",
136
+ 0.0778837462113562
137
+ ],
138
+ [
139
+ "and",
140
+ 0.07387174047283641
141
+ ],
142
+ [
143
+ "details",
144
+ 0.07121357997239698
145
+ ],
146
+ [
147
+ "account",
148
+ 0.06107877265996873
149
+ ],
150
+ [
151
+ "call",
152
+ 0.05786738490569826
153
+ ],
154
+ [
155
+ "card",
156
+ 0.05459288080457491
157
+ ],
158
+ [
159
+ "someone",
160
+ 0.05113457291213346
161
+ ],
162
+ [
163
+ "this",
164
+ 0.051056373196725964
165
+ ],
166
+ [
167
+ "worried",
168
+ 0.04984950598067789
169
+ ]
170
+ ],
171
+ "3": [
172
+ [
173
+ "store",
174
+ 0.08068849143662853
175
+ ],
176
+ [
177
+ "the",
178
+ 0.07418625377113114
179
+ ],
180
+ [
181
+ "it",
182
+ 0.07287641056570636
183
+ ],
184
+ [
185
+ "refund",
186
+ 0.06783625470050814
187
+ ],
188
+ [
189
+ "back",
190
+ 0.06783625470050814
191
+ ],
192
+ [
193
+ "for",
194
+ 0.06532535937718241
195
+ ],
196
+ [
197
+ "to",
198
+ 0.06124252441610852
199
+ ],
200
+ [
201
+ "credit",
202
+ 0.0593815717854626
203
+ ],
204
+ [
205
+ "ago",
206
+ 0.05849200859752171
207
+ ],
208
+ [
209
+ "days",
210
+ 0.05706008655023621
211
+ ]
212
+ ]
213
+ },
214
+ "topics": [
215
+ 2,
216
+ 3,
217
+ 0,
218
+ 2,
219
+ -1,
220
+ 3,
221
+ -1,
222
+ -1,
223
+ -1,
224
+ -1,
225
+ -1,
226
+ 0,
227
+ 1,
228
+ -1,
229
+ 1,
230
+ -1,
231
+ -1,
232
+ -1,
233
+ 0,
234
+ -1,
235
+ 3,
236
+ -1,
237
+ -1,
238
+ -1,
239
+ 1,
240
+ -1,
241
+ -1,
242
+ -1,
243
+ 0,
244
+ 1,
245
+ 1,
246
+ -1,
247
+ -1,
248
+ -1,
249
+ 0,
250
+ 3,
251
+ 3,
252
+ 3,
253
+ 3,
254
+ 0,
255
+ -1,
256
+ 0,
257
+ -1,
258
+ 1,
259
+ 3,
260
+ 1,
261
+ 1,
262
+ -1,
263
+ -1,
264
+ 0,
265
+ -1,
266
+ 1,
267
+ -1,
268
+ -1,
269
+ -1,
270
+ -1,
271
+ 2,
272
+ -1,
273
+ 2,
274
+ 1,
275
+ 0,
276
+ 2,
277
+ 0,
278
+ -1,
279
+ 0,
280
+ 2,
281
+ -1,
282
+ -1,
283
+ 2,
284
+ 2,
285
+ 2,
286
+ 2,
287
+ 2,
288
+ 2,
289
+ 2,
290
+ 2,
291
+ 0,
292
+ 2,
293
+ 2,
294
+ 2,
295
+ 0,
296
+ 2,
297
+ -1,
298
+ 2,
299
+ 2,
300
+ 0,
301
+ 2,
302
+ 2,
303
+ -1,
304
+ -1,
305
+ -1,
306
+ -1,
307
+ 0,
308
+ -1,
309
+ 0,
310
+ 3,
311
+ 3,
312
+ 3,
313
+ 0,
314
+ 3,
315
+ -1,
316
+ -1,
317
+ 3,
318
+ 3,
319
+ 0,
320
+ 0,
321
+ 0,
322
+ 1,
323
+ 1,
324
+ 1,
325
+ 1,
326
+ -1,
327
+ 1,
328
+ 0,
329
+ 0,
330
+ 0,
331
+ 0,
332
+ -1,
333
+ 0,
334
+ 0,
335
+ 0,
336
+ 0,
337
+ -1,
338
+ 0,
339
+ -1,
340
+ 0,
341
+ 0,
342
+ 0,
343
+ 0,
344
+ 0,
345
+ 0,
346
+ 0,
347
+ 0,
348
+ -1,
349
+ 0,
350
+ 0,
351
+ 0,
352
+ 0,
353
+ -1,
354
+ 0,
355
+ 0,
356
+ 0,
357
+ -1,
358
+ 0,
359
+ 0,
360
+ 0,
361
+ 0,
362
+ 0,
363
+ 2,
364
+ 1,
365
+ 1,
366
+ 0,
367
+ 2,
368
+ -1,
369
+ 1,
370
+ -1,
371
+ -1,
372
+ 1,
373
+ 1,
374
+ 1,
375
+ 1,
376
+ 1,
377
+ 1,
378
+ 1,
379
+ 1,
380
+ 1,
381
+ 3,
382
+ 1
383
+ ],
384
+ "topic_sizes": {
385
+ "2": 24,
386
+ "3": 15,
387
+ "0": 50,
388
+ "-1": 51,
389
+ "1": 28
390
+ },
391
+ "topic_mapper": [
392
+ [
393
+ -1,
394
+ -1,
395
+ -1,
396
+ -1
397
+ ],
398
+ [
399
+ 0,
400
+ 0,
401
+ 0,
402
+ 2
403
+ ],
404
+ [
405
+ 1,
406
+ 1,
407
+ 1,
408
+ 0
409
+ ],
410
+ [
411
+ 2,
412
+ 2,
413
+ 2,
414
+ 3
415
+ ],
416
+ [
417
+ 3,
418
+ 3,
419
+ 3,
420
+ 1
421
+ ]
422
+ ],
423
+ "topic_labels": {
424
+ "-1": "-1_for_klarna_to_my",
425
+ "0": "0_klarna_my_declined_for",
426
+ "1": "1_payment_to_the_my",
427
+ "2": "2_my_klarna_and_details",
428
+ "3": "3_store_the_it_refund"
429
+ },
430
+ "custom_labels": null,
431
+ "_outliers": 1,
432
+ "topic_aspects": {}
433
+ }