CarlosMorales
commited on
Add BERTopic model
Browse files- README.md +72 -0
- config.json +17 -0
- topic_embeddings.safetensors +3 -0
- topics.json +262 -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 |
+
# bbc_news_topics
|
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("CarlosMorales/bbc_news_topics")
|
27 |
+
|
28 |
+
topic_model.get_topic_info()
|
29 |
+
```
|
30 |
+
|
31 |
+
## Topic overview
|
32 |
+
|
33 |
+
* Number of topics: 3
|
34 |
+
* Number of training documents: 100
|
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 | the - of - to - and - eu | 28 | -1_the_of_to_and |
|
42 |
+
| 0 | the - of - to - and - in | 6 | 0_the_of_to_and |
|
43 |
+
| 1 | the - to - of - and - in | 66 | 1_the_to_of_and |
|
44 |
+
|
45 |
+
</details>
|
46 |
+
|
47 |
+
## Training hyperparameters
|
48 |
+
|
49 |
+
* calculate_probabilities: False
|
50 |
+
* language: english
|
51 |
+
* low_memory: False
|
52 |
+
* min_topic_size: 10
|
53 |
+
* n_gram_range: (1, 1)
|
54 |
+
* nr_topics: None
|
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.33
|
65 |
+
* UMAP: 0.5.6
|
66 |
+
* Pandas: 2.2.1
|
67 |
+
* Scikit-Learn: 1.4.1.post1
|
68 |
+
* Sentence-transformers: 2.6.1
|
69 |
+
* Transformers: 4.39.3
|
70 |
+
* Numba: 0.59.1
|
71 |
+
* Plotly: 5.20.0
|
72 |
+
* Python: 3.11.6
|
config.json
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"calculate_probabilities": false,
|
3 |
+
"language": "english",
|
4 |
+
"low_memory": false,
|
5 |
+
"min_topic_size": 10,
|
6 |
+
"n_gram_range": [
|
7 |
+
1,
|
8 |
+
1
|
9 |
+
],
|
10 |
+
"nr_topics": null,
|
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 |
+
"embedding_model": "sentence-transformers/all-Mi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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"topic_representations": {
|
3 |
+
"-1": [
|
4 |
+
[
|
5 |
+
"the",
|
6 |
+
0.13804656283058866
|
7 |
+
],
|
8 |
+
[
|
9 |
+
"of",
|
10 |
+
0.07825405363842275
|
11 |
+
],
|
12 |
+
[
|
13 |
+
"to",
|
14 |
+
0.0772985504098433
|
15 |
+
],
|
16 |
+
[
|
17 |
+
"and",
|
18 |
+
0.057608023675185964
|
19 |
+
],
|
20 |
+
[
|
21 |
+
"eu",
|
22 |
+
0.05441345274003265
|
23 |
+
],
|
24 |
+
[
|
25 |
+
"in",
|
26 |
+
0.054258494077856614
|
27 |
+
],
|
28 |
+
[
|
29 |
+
"is",
|
30 |
+
0.04620225771054437
|
31 |
+
],
|
32 |
+
[
|
33 |
+
"brexit",
|
34 |
+
0.04166188146807172
|
35 |
+
],
|
36 |
+
[
|
37 |
+
"european",
|
38 |
+
0.037377992114263486
|
39 |
+
],
|
40 |
+
[
|
41 |
+
"uk",
|
42 |
+
0.03479815498437571
|
43 |
+
]
|
44 |
+
],
|
45 |
+
"0": [
|
46 |
+
[
|
47 |
+
"the",
|
48 |
+
0.10874855481558174
|
49 |
+
],
|
50 |
+
[
|
51 |
+
"of",
|
52 |
+
0.06634622479412591
|
53 |
+
],
|
54 |
+
[
|
55 |
+
"to",
|
56 |
+
0.06451676138637687
|
57 |
+
],
|
58 |
+
[
|
59 |
+
"and",
|
60 |
+
0.06281384435758307
|
61 |
+
],
|
62 |
+
[
|
63 |
+
"in",
|
64 |
+
0.06036585051618699
|
65 |
+
],
|
66 |
+
[
|
67 |
+
"on",
|
68 |
+
0.04067850804885957
|
69 |
+
],
|
70 |
+
[
|
71 |
+
"was",
|
72 |
+
0.0379906368007012
|
73 |
+
],
|
74 |
+
[
|
75 |
+
"is",
|
76 |
+
0.037654043139849894
|
77 |
+
],
|
78 |
+
[
|
79 |
+
"for",
|
80 |
+
0.03695174642522398
|
81 |
+
],
|
82 |
+
[
|
83 |
+
"it",
|
84 |
+
0.031825849733819044
|
85 |
+
]
|
86 |
+
],
|
87 |
+
"1": [
|
88 |
+
[
|
89 |
+
"the",
|
90 |
+
0.12256853839401158
|
91 |
+
],
|
92 |
+
[
|
93 |
+
"to",
|
94 |
+
0.07758366134034063
|
95 |
+
],
|
96 |
+
[
|
97 |
+
"of",
|
98 |
+
0.06958004226056384
|
99 |
+
],
|
100 |
+
[
|
101 |
+
"and",
|
102 |
+
0.06074592235451145
|
103 |
+
],
|
104 |
+
[
|
105 |
+
"in",
|
106 |
+
0.055861273979050344
|
107 |
+
],
|
108 |
+
[
|
109 |
+
"trump",
|
110 |
+
0.04639481547390947
|
111 |
+
],
|
112 |
+
[
|
113 |
+
"as",
|
114 |
+
0.04060120868254382
|
115 |
+
],
|
116 |
+
[
|
117 |
+
"that",
|
118 |
+
0.04004072506992107
|
119 |
+
],
|
120 |
+
[
|
121 |
+
"on",
|
122 |
+
0.03557763021260862
|
123 |
+
],
|
124 |
+
[
|
125 |
+
"for",
|
126 |
+
0.03549585785428864
|
127 |
+
]
|
128 |
+
]
|
129 |
+
},
|
130 |
+
"topics": [
|
131 |
+
0,
|
132 |
+
0,
|
133 |
+
0,
|
134 |
+
0,
|
135 |
+
0,
|
136 |
+
0,
|
137 |
+
0,
|
138 |
+
0,
|
139 |
+
0,
|
140 |
+
0,
|
141 |
+
0,
|
142 |
+
1,
|
143 |
+
0,
|
144 |
+
1,
|
145 |
+
1,
|
146 |
+
0,
|
147 |
+
0,
|
148 |
+
0,
|
149 |
+
0,
|
150 |
+
1,
|
151 |
+
0,
|
152 |
+
1,
|
153 |
+
0,
|
154 |
+
0,
|
155 |
+
1,
|
156 |
+
1,
|
157 |
+
1,
|
158 |
+
0,
|
159 |
+
1,
|
160 |
+
0,
|
161 |
+
1,
|
162 |
+
0,
|
163 |
+
1,
|
164 |
+
0,
|
165 |
+
1,
|
166 |
+
1,
|
167 |
+
0,
|
168 |
+
-1,
|
169 |
+
1,
|
170 |
+
1,
|
171 |
+
0,
|
172 |
+
0,
|
173 |
+
0,
|
174 |
+
0,
|
175 |
+
0,
|
176 |
+
1,
|
177 |
+
1,
|
178 |
+
1,
|
179 |
+
0,
|
180 |
+
1,
|
181 |
+
1,
|
182 |
+
0,
|
183 |
+
1,
|
184 |
+
0,
|
185 |
+
-1,
|
186 |
+
0,
|
187 |
+
-1,
|
188 |
+
0,
|
189 |
+
1,
|
190 |
+
1,
|
191 |
+
0,
|
192 |
+
0,
|
193 |
+
1,
|
194 |
+
0,
|
195 |
+
0,
|
196 |
+
0,
|
197 |
+
1,
|
198 |
+
0,
|
199 |
+
0,
|
200 |
+
0,
|
201 |
+
0,
|
202 |
+
-1,
|
203 |
+
0,
|
204 |
+
0,
|
205 |
+
0,
|
206 |
+
0,
|
207 |
+
1,
|
208 |
+
1,
|
209 |
+
0,
|
210 |
+
0,
|
211 |
+
0,
|
212 |
+
0,
|
213 |
+
0,
|
214 |
+
0,
|
215 |
+
0,
|
216 |
+
0,
|
217 |
+
0,
|
218 |
+
1,
|
219 |
+
0,
|
220 |
+
0,
|
221 |
+
0,
|
222 |
+
0,
|
223 |
+
0,
|
224 |
+
0,
|
225 |
+
0,
|
226 |
+
-1,
|
227 |
+
-1,
|
228 |
+
0,
|
229 |
+
0,
|
230 |
+
0
|
231 |
+
],
|
232 |
+
"topic_sizes": {
|
233 |
+
"0": 66,
|
234 |
+
"1": 28,
|
235 |
+
"-1": 6
|
236 |
+
},
|
237 |
+
"topic_mapper": [
|
238 |
+
[
|
239 |
+
-1,
|
240 |
+
-1,
|
241 |
+
-1
|
242 |
+
],
|
243 |
+
[
|
244 |
+
0,
|
245 |
+
0,
|
246 |
+
1
|
247 |
+
],
|
248 |
+
[
|
249 |
+
1,
|
250 |
+
1,
|
251 |
+
0
|
252 |
+
]
|
253 |
+
],
|
254 |
+
"topic_labels": {
|
255 |
+
"-1": "-1_the_of_to_and",
|
256 |
+
"0": "0_the_of_to_and",
|
257 |
+
"1": "1_the_to_of_and"
|
258 |
+
},
|
259 |
+
"custom_labels": null,
|
260 |
+
"_outliers": 1,
|
261 |
+
"topic_aspects": {}
|
262 |
+
}
|