juanpprim commited on
Commit
0091d2e
·
verified ·
1 Parent(s): aa5c183

Add BERTopic model

Browse files
Files changed (4) hide show
  1. README.md +72 -0
  2. config.json +16 -0
  3. topic_embeddings.safetensors +3 -0
  4. topics.json +333 -0
README.md ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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("juanpprim/rag-topic-model")
27
+
28
+ topic_model.get_topic_info()
29
+ ```
30
+
31
+ ## Topic overview
32
+
33
+ * Number of topics: 3
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 - the - card - just | 26 | -1_for_klarna_the_card |
42
+ | 0 | my - the - to - for - klarna | 22 | 0_my_the_to_for |
43
+ | 1 | my - klarna - and - details - account | 120 | 1_my_klarna_and_details |
44
+
45
+ </details>
46
+
47
+ ## Training hyperparameters
48
+
49
+ * calculate_probabilities: False
50
+ * language: None
51
+ * low_memory: False
52
+ * min_topic_size: 10
53
+ * n_gram_range: (1, 1)
54
+ * nr_topics: auto
55
+ * seed_topic_list: None
56
+ * top_n_words: 10
57
+ * verbose: False
58
+ * zeroshot_min_similarity: 0.7
59
+ * zeroshot_topic_list: None
60
+
61
+ ## Framework versions
62
+
63
+ * Numpy: 1.26.4
64
+ * HDBSCAN: 0.8.40
65
+ * UMAP: 0.5.7
66
+ * Pandas: 2.3.0+4.g1dfc98e16a
67
+ * Scikit-Learn: 1.6.1
68
+ * Sentence-transformers: 4.1.0
69
+ * Transformers: 4.42.2
70
+ * Numba: 0.60.0
71
+ * Plotly: 6.1.2
72
+ * Python: 3.9.22
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:1d05e4b2e78c19e89c94de89c9068736bd851100cba9032b0e0ae18b875fd8a8
3
+ size 4696
topics.json ADDED
@@ -0,0 +1,333 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "topic_representations": {
3
+ "-1": [
4
+ [
5
+ "for",
6
+ 0.10355802038244319
7
+ ],
8
+ [
9
+ "klarna",
10
+ 0.08531906485750988
11
+ ],
12
+ [
13
+ "the",
14
+ 0.0771672808288941
15
+ ],
16
+ [
17
+ "card",
18
+ 0.07226678473766522
19
+ ],
20
+ [
21
+ "just",
22
+ 0.06541217592510544
23
+ ],
24
+ [
25
+ "dyson",
26
+ 0.06484631804678305
27
+ ],
28
+ [
29
+ "to",
30
+ 0.06303531675453064
31
+ ],
32
+ [
33
+ "added",
34
+ 0.06099165799709321
35
+ ],
36
+ [
37
+ "my",
38
+ 0.05993882417963966
39
+ ],
40
+ [
41
+ "and",
42
+ 0.056130381243253265
43
+ ]
44
+ ],
45
+ "0": [
46
+ [
47
+ "my",
48
+ 0.08083765642630698
49
+ ],
50
+ [
51
+ "the",
52
+ 0.07558253527020153
53
+ ],
54
+ [
55
+ "to",
56
+ 0.07216830919750777
57
+ ],
58
+ [
59
+ "for",
60
+ 0.07076698280532315
61
+ ],
62
+ [
63
+ "klarna",
64
+ 0.06428856250925537
65
+ ],
66
+ [
67
+ "payment",
68
+ 0.05795183835033791
69
+ ],
70
+ [
71
+ "and",
72
+ 0.05002640080051296
73
+ ],
74
+ [
75
+ "but",
76
+ 0.0466325264314561
77
+ ],
78
+ [
79
+ "in",
80
+ 0.045919616815271895
81
+ ],
82
+ [
83
+ "is",
84
+ 0.04252084027564602
85
+ ]
86
+ ],
87
+ "1": [
88
+ [
89
+ "my",
90
+ 0.1351561721697757
91
+ ],
92
+ [
93
+ "klarna",
94
+ 0.09192965885127655
95
+ ],
96
+ [
97
+ "and",
98
+ 0.08175477707116117
99
+ ],
100
+ [
101
+ "details",
102
+ 0.08123456790885807
103
+ ],
104
+ [
105
+ "account",
106
+ 0.07081689460829162
107
+ ],
108
+ [
109
+ "to",
110
+ 0.06412261323990291
111
+ ],
112
+ [
113
+ "email",
114
+ 0.06321650300279098
115
+ ],
116
+ [
117
+ "call",
118
+ 0.05915959535450327
119
+ ],
120
+ [
121
+ "card",
122
+ 0.058963804626642476
123
+ ],
124
+ [
125
+ "this",
126
+ 0.05560890637529034
127
+ ]
128
+ ]
129
+ },
130
+ "topics": [
131
+ 1,
132
+ 0,
133
+ 0,
134
+ 1,
135
+ -1,
136
+ 0,
137
+ 0,
138
+ -1,
139
+ -1,
140
+ 0,
141
+ 0,
142
+ 0,
143
+ 0,
144
+ -1,
145
+ 0,
146
+ 0,
147
+ -1,
148
+ -1,
149
+ 0,
150
+ -1,
151
+ 0,
152
+ -1,
153
+ -1,
154
+ -1,
155
+ 0,
156
+ -1,
157
+ -1,
158
+ 0,
159
+ 0,
160
+ 0,
161
+ 0,
162
+ 0,
163
+ 0,
164
+ 0,
165
+ 0,
166
+ 0,
167
+ 0,
168
+ 0,
169
+ 0,
170
+ 0,
171
+ -1,
172
+ 0,
173
+ -1,
174
+ 0,
175
+ 0,
176
+ 0,
177
+ 0,
178
+ 1,
179
+ 0,
180
+ 0,
181
+ 0,
182
+ 0,
183
+ 0,
184
+ -1,
185
+ 0,
186
+ 0,
187
+ 1,
188
+ 0,
189
+ 1,
190
+ 0,
191
+ 0,
192
+ 1,
193
+ 0,
194
+ 0,
195
+ 0,
196
+ 1,
197
+ -1,
198
+ -1,
199
+ 1,
200
+ 1,
201
+ 1,
202
+ 1,
203
+ 1,
204
+ 1,
205
+ 1,
206
+ 1,
207
+ 0,
208
+ 1,
209
+ 1,
210
+ 1,
211
+ 0,
212
+ 1,
213
+ 1,
214
+ 1,
215
+ 1,
216
+ 0,
217
+ 1,
218
+ 1,
219
+ -1,
220
+ 0,
221
+ 0,
222
+ 0,
223
+ 0,
224
+ 0,
225
+ 0,
226
+ 0,
227
+ 0,
228
+ 0,
229
+ 0,
230
+ 0,
231
+ -1,
232
+ 0,
233
+ 0,
234
+ 0,
235
+ 0,
236
+ 0,
237
+ 0,
238
+ 0,
239
+ 0,
240
+ 0,
241
+ 0,
242
+ 0,
243
+ 0,
244
+ 0,
245
+ 0,
246
+ 0,
247
+ 0,
248
+ 0,
249
+ 0,
250
+ 0,
251
+ 0,
252
+ 0,
253
+ 0,
254
+ 0,
255
+ -1,
256
+ 0,
257
+ 0,
258
+ 0,
259
+ 0,
260
+ 0,
261
+ 0,
262
+ 0,
263
+ 0,
264
+ 0,
265
+ 0,
266
+ 0,
267
+ 0,
268
+ 0,
269
+ -1,
270
+ 0,
271
+ 0,
272
+ 0,
273
+ 0,
274
+ 0,
275
+ 0,
276
+ 0,
277
+ 0,
278
+ 0,
279
+ 1,
280
+ 0,
281
+ 0,
282
+ 0,
283
+ 1,
284
+ -1,
285
+ 0,
286
+ 0,
287
+ 0,
288
+ 0,
289
+ 0,
290
+ 0,
291
+ 0,
292
+ 0,
293
+ 0,
294
+ 0,
295
+ 0,
296
+ 0,
297
+ 0,
298
+ 0
299
+ ],
300
+ "topic_sizes": {
301
+ "1": 26,
302
+ "0": 120,
303
+ "-1": 22
304
+ },
305
+ "topic_mapper": [
306
+ [
307
+ -1,
308
+ -1,
309
+ -1,
310
+ -1
311
+ ],
312
+ [
313
+ 0,
314
+ 0,
315
+ 0,
316
+ 1
317
+ ],
318
+ [
319
+ 1,
320
+ 1,
321
+ 1,
322
+ 0
323
+ ]
324
+ ],
325
+ "topic_labels": {
326
+ "-1": "-1_for_klarna_the_card",
327
+ "0": "0_my_the_to_for",
328
+ "1": "1_my_klarna_and_details"
329
+ },
330
+ "custom_labels": null,
331
+ "_outliers": 1,
332
+ "topic_aspects": {}
333
+ }