Add BERTopic model
Browse files- README.md +147 -0
- config.json +15 -0
- topic_embeddings.safetensors +3 -0
- topics.json +0 -0
README.md
ADDED
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
---
|
3 |
+
tags:
|
4 |
+
- bertopic
|
5 |
+
library_name: bertopic
|
6 |
+
pipeline_tag: text-classification
|
7 |
+
---
|
8 |
+
|
9 |
+
# xsum_108_50000_25000_validation
|
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("KingKazma/xsum_108_50000_25000_validation")
|
27 |
+
|
28 |
+
topic_model.get_topic_info()
|
29 |
+
```
|
30 |
+
|
31 |
+
## Topic overview
|
32 |
+
|
33 |
+
* Number of topics: 80
|
34 |
+
* Number of training documents: 11332
|
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 | said - mr - people - would - also | 5 | -1_said_mr_people_would |
|
42 |
+
| 0 | win - game - league - club - player | 4532 | 0_win_game_league_club |
|
43 |
+
| 1 | police - court - said - mr - officer | 2119 | 1_police_court_said_mr |
|
44 |
+
| 2 | world - sport - olympic - champion - gold | 1037 | 2_world_sport_olympic_champion |
|
45 |
+
| 3 | bank - sale - growth - price - rate | 604 | 3_bank_sale_growth_price |
|
46 |
+
| 4 | data - user - company - firm - mobile | 225 | 4_data_user_company_firm |
|
47 |
+
| 5 | film - star - album - show - best | 204 | 5_film_star_album_show |
|
48 |
+
| 6 | school - education - pupil - teacher - student | 183 | 6_school_education_pupil_teacher |
|
49 |
+
| 7 | nhs - care - patient - hospital - health | 107 | 7_nhs_care_patient_hospital |
|
50 |
+
| 8 | boko - haram - president - un - mr | 103 | 8_boko_haram_president_un |
|
51 |
+
| 9 | labour - party - corbyn - ukip - mps | 94 | 9_labour_party_corbyn_ukip |
|
52 |
+
| 10 | bird - specie - tree - ash - animal | 82 | 10_bird_specie_tree_ash |
|
53 |
+
| 11 | northern - ireland - sinn - fin - dup | 77 | 11_northern_ireland_sinn_fin |
|
54 |
+
| 12 | trump - mr - clinton - republican - president | 73 | 12_trump_mr_clinton_republican |
|
55 |
+
| 13 | fire - blaze - smoke - scene - firefighter | 73 | 13_fire_blaze_smoke_scene |
|
56 |
+
| 14 | water - flood - flooding - river - rain | 67 | 14_water_flood_flooding_river |
|
57 |
+
| 15 | art - museum - artist - gallery - auction | 63 | 15_art_museum_artist_gallery |
|
58 |
+
| 16 | transport - road - route - traffic - bridge | 58 | 16_transport_road_route_traffic |
|
59 |
+
| 17 | ebola - virus - outbreak - vaccine - health | 54 | 17_ebola_virus_outbreak_vaccine |
|
60 |
+
| 18 | syrian - syria - rebel - aleppo - iraq | 53 | 18_syrian_syria_rebel_aleppo |
|
61 |
+
| 19 | race - hamilton - f1 - mercedes - rosberg | 51 | 19_race_hamilton_f1_mercedes |
|
62 |
+
| 20 | welsh - wales - plaid - assembly - labour | 51 | 20_welsh_wales_plaid_assembly |
|
63 |
+
| 21 | council - site - building - planning - centre | 49 | 21_council_site_building_planning |
|
64 |
+
| 22 | rmt - rail - train - strike - service | 47 | 22_rmt_rail_train_strike |
|
65 |
+
| 23 | ice - space - satellite - scientist - earth | 47 | 23_ice_space_satellite_scientist |
|
66 |
+
| 24 | flight - plane - airport - aircraft - pilot | 45 | 24_flight_plane_airport_aircraft |
|
67 |
+
| 25 | korea - north - china - korean - us | 43 | 25_korea_north_china_korean |
|
68 |
+
| 26 | eu - uk - brexit - migration - immigration | 43 | 26_eu_uk_brexit_migration |
|
69 |
+
| 27 | taliban - afghan - afghanistan - kabul - attack | 43 | 27_taliban_afghan_afghanistan_kabul |
|
70 |
+
| 28 | hong - kong - china - chinese - liu | 42 | 28_hong_kong_china_chinese |
|
71 |
+
| 29 | energy - wind - turbine - farm - electricity | 42 | 29_energy_wind_turbine_farm |
|
72 |
+
| 30 | maduro - farc - president - venezuela - opposition | 42 | 30_maduro_farc_president_venezuela |
|
73 |
+
| 31 | scottish - scotland - referendum - snp - independence | 41 | 31_scottish_scotland_referendum_snp |
|
74 |
+
| 32 | cancer - risk - woman - study - diabetes | 41 | 32_cancer_risk_woman_study |
|
75 |
+
| 33 | war - battle - royal - service - regiment | 40 | 33_war_battle_royal_service |
|
76 |
+
| 34 | yn - ar - ei - yr - bod | 40 | 34_yn_ar_ei_yr |
|
77 |
+
| 35 | space - mars - iss - astronaut - updated | 39 | 35_space_mars_iss_astronaut |
|
78 |
+
| 36 | india - indias - delhi - hindu - indian | 39 | 36_india_indias_delhi_hindu |
|
79 |
+
| 37 | russia - russian - ukraine - putin - president | 38 | 37_russia_russian_ukraine_putin |
|
80 |
+
| 38 | tax - budget - chancellor - government - osborne | 37 | 38_tax_budget_chancellor_government |
|
81 |
+
| 39 | coastguard - boat - lifeboat - rnli - rescue | 32 | 39_coastguard_boat_lifeboat_rnli |
|
82 |
+
| 40 | elephant - ivory - zoo - animal - rhino | 32 | 40_elephant_ivory_zoo_animal |
|
83 |
+
| 41 | pension - pay - wage - income - pot | 32 | 41_pension_pay_wage_income |
|
84 |
+
| 42 | abortion - marriage - woman - samesex - gay | 31 | 42_abortion_marriage_woman_samesex |
|
85 |
+
| 43 | paris - french - attack - france - jewish | 29 | 43_paris_french_attack_france |
|
86 |
+
| 44 | dog - pet - animal - hare - police | 26 | 44_dog_pet_animal_hare |
|
87 |
+
| 45 | unsupported - updated - playback - device - media | 25 | 45_unsupported_updated_playback_device |
|
88 |
+
| 46 | pollution - waste - air - bag - bin | 24 | 46_pollution_waste_air_bag |
|
89 |
+
| 47 | climate - carbon - emission - coal - gas | 24 | 47_climate_carbon_emission_coal |
|
90 |
+
| 48 | mortgage - credit - lender - price - property | 24 | 48_mortgage_credit_lender_price |
|
91 |
+
| 49 | ahmed - court - terrorism - police - naseer | 24 | 49_ahmed_court_terrorism_police |
|
92 |
+
| 50 | train - driver - raib - incident - rail | 23 | 50_train_driver_raib_incident |
|
93 |
+
| 51 | hoard - coin - museum - display - found | 23 | 51_hoard_coin_museum_display |
|
94 |
+
| 52 | eu - trade - uk - market - brexit | 23 | 52_eu_trade_uk_market |
|
95 |
+
| 53 | greece - greek - eurozone - debt - bailout | 22 | 53_greece_greek_eurozone_debt |
|
96 |
+
| 54 | whale - shark - water - dolphin - fish | 21 | 54_whale_shark_water_dolphin |
|
97 |
+
| 55 | steel - tata - industry - plant - uk | 17 | 55_steel_tata_industry_plant |
|
98 |
+
| 56 | prince - duchess - duke - royal - princess | 15 | 56_prince_duchess_duke_royal |
|
99 |
+
| 57 | camp - nazi - locsin - germany - extradition | 15 | 57_camp_nazi_locsin_germany |
|
100 |
+
| 58 | migrant - refugee - border - turkey - greek | 15 | 58_migrant_refugee_border_turkey |
|
101 |
+
| 59 | calais - migrant - camp - jungle - refugee | 14 | 59_calais_migrant_camp_jungle |
|
102 |
+
| 60 | gun - violence - police - shooting - baltimore | 14 | 60_gun_violence_police_shooting |
|
103 |
+
| 61 | rousseff - impeachment - senate - temer - petrobras | 13 | 61_rousseff_impeachment_senate_temer |
|
104 |
+
| 62 | macron - le - germany - pen - macrons | 13 | 62_macron_le_germany_pen |
|
105 |
+
| 63 | turkey - erdogan - turkish - turkeys - hdp | 13 | 63_turkey_erdogan_turkish_turkeys |
|
106 |
+
| 64 | lodge - belfast - ballysillan - parade - paper | 12 | 64_lodge_belfast_ballysillan_parade |
|
107 |
+
| 65 | castle - hull - staffin - crofters - house | 11 | 65_castle_hull_staffin_crofters |
|
108 |
+
| 66 | food - cocoa - fairtrade - advertising - sale | 10 | 66_food_cocoa_fairtrade_advertising |
|
109 |
+
| 67 | israel - hamas - israeli - gaza - palestinians | 10 | 67_israel_hamas_israeli_gaza |
|
110 |
+
| 68 | bank - account - rbs - overdraft - note | 10 | 68_bank_account_rbs_overdraft |
|
111 |
+
| 69 | runway - airport - heathrow - airports - flight | 8 | 69_runway_airport_heathrow_airports |
|
112 |
+
| 70 | rescue - mountain - avalanche - climbing - nepal | 7 | 70_rescue_mountain_avalanche_climbing |
|
113 |
+
| 71 | council - privatisation - deal - government - carmarthenshires | 7 | 71_council_privatisation_deal_government |
|
114 |
+
| 72 | ruddy - inla - information - police - family | 6 | 72_ruddy_inla_information_police |
|
115 |
+
| 73 | drug - prescribed - psychoactive - drugs - lyrica | 6 | 73_drug_prescribed_psychoactive_drugs |
|
116 |
+
| 74 | kitty - book - author - publisher - prize | 6 | 74_kitty_book_author_publisher |
|
117 |
+
| 75 | search - cabin - airways - plane - amsa | 6 | 75_search_cabin_airways_plane |
|
118 |
+
| 76 | sterkel - alert - examined - detonated - rifle | 6 | 76_sterkel_alert_examined_detonated |
|
119 |
+
| 77 | ambulance - service - aberglaslyn - called - inverclyde | 5 | 77_ambulance_service_aberglaslyn_called |
|
120 |
+
| 78 | research - 3d - science - prof - vision | 5 | 78_research_3d_science_prof |
|
121 |
+
|
122 |
+
</details>
|
123 |
+
|
124 |
+
## Training hyperparameters
|
125 |
+
|
126 |
+
* calculate_probabilities: True
|
127 |
+
* language: english
|
128 |
+
* low_memory: False
|
129 |
+
* min_topic_size: 10
|
130 |
+
* n_gram_range: (1, 1)
|
131 |
+
* nr_topics: None
|
132 |
+
* seed_topic_list: None
|
133 |
+
* top_n_words: 10
|
134 |
+
* verbose: False
|
135 |
+
|
136 |
+
## Framework versions
|
137 |
+
|
138 |
+
* Numpy: 1.22.4
|
139 |
+
* HDBSCAN: 0.8.33
|
140 |
+
* UMAP: 0.5.3
|
141 |
+
* Pandas: 1.5.3
|
142 |
+
* Scikit-Learn: 1.2.2
|
143 |
+
* Sentence-transformers: 2.2.2
|
144 |
+
* Transformers: 4.31.0
|
145 |
+
* Numba: 0.57.1
|
146 |
+
* Plotly: 5.13.1
|
147 |
+
* Python: 3.10.12
|
config.json
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"calculate_probabilities": true,
|
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 |
+
"embedding_model": "sentence-transformers/all-MiniLM-L6-v2"
|
15 |
+
}
|
topic_embeddings.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a412469a03d4f21eb645911392487847f1c1c00a510484c46e796452cd0013aa
|
3 |
+
size 122968
|
topics.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|