Ayomidedeji commited on
Commit
f26170f
1 Parent(s): 7d50601

Add BERTopic model

Browse files
Files changed (7) hide show
  1. .gitattributes +1 -0
  2. README.md +167 -0
  3. config.json +17 -0
  4. ctfidf.bin +3 -0
  5. ctfidf_config.json +3 -0
  6. topic_embeddings.bin +3 -0
  7. topics.json +0 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ ctfidf_config.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+ tags:
4
+ - bertopic
5
+ library_name: bertopic
6
+ pipeline_tag: text-classification
7
+ ---
8
+
9
+ # yelpreview_base
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("Ayomidedeji/yelpreview_base")
27
+
28
+ topic_model.get_topic_info()
29
+ ```
30
+
31
+ ## Topic overview
32
+
33
+ * Number of topics: 98
34
+ * Number of training documents: 10000
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 | food - good - place - great - like | 10 | -1_food_good_place_great |
42
+ | 0 | mexican - tacos - salsa - burrito - food | 3827 | 0_mexican_tacos_salsa_burrito |
43
+ | 1 | pizza - crust - pizzas - good - wait | 705 | 1_pizza_crust_pizzas_good |
44
+ | 2 | bar - music - drinks - night - place | 393 | 2_bar_music_drinks_night |
45
+ | 3 | burger - fries - burgers - good - like | 288 | 3_burger_fries_burgers_good |
46
+ | 4 | ordered - just - bread - good - chicken | 275 | 4_ordered_just_bread_good |
47
+ | 5 | sushi - roll - rolls - happy hour - happy | 261 | 5_sushi_roll_rolls_happy hour |
48
+ | 6 | scottsdale - place - great - bar - food | 191 | 6_scottsdale_place_great_bar |
49
+ | 7 | coffee - starbucks - coffee shop - shop - espresso | 190 | 7_coffee_starbucks_coffee shop_shop |
50
+ | 8 | hotel - pool - room - stay - resort | 186 | 8_hotel_pool_room_stay |
51
+ | 9 | minutes - table - server - asked - came | 183 | 9_minutes_table_server_asked |
52
+ | 10 | chinese - chinese food - food - asian - china | 145 | 10_chinese_chinese food_food_asian |
53
+ | 11 | thai - pad - curry - pad thai - thai food | 131 | 11_thai_pad_curry_pad thai |
54
+ | 12 | beer - beers - peaks - brewery - craft | 131 | 12_beer_beers_peaks_brewery |
55
+ | 13 | breakfast - eggs - pancakes - toast - french toast | 115 | 13_breakfast_eggs_pancakes_toast |
56
+ | 14 | pho - vietnamese - spring rolls - spring - broth | 104 | 14_pho_vietnamese_spring rolls_spring |
57
+ | 15 | bbq - brisket - ribs - sauce - pork | 94 | 15_bbq_brisket_ribs_sauce |
58
+ | 16 | theater - movie - seats - movies - theaters | 84 | 16_theater_movie_seats_movies |
59
+ | 17 | food - place - great - lunch - love | 82 | 17_food_place_great_lunch |
60
+ | 18 | hair - cut - salon - haircut - barber | 81 | 18_hair_cut_salon_haircut |
61
+ | 19 | great - valentine - food - patio - valentine day | 78 | 19_great_valentine_food_patio |
62
+ | 20 | service - food - server - servers - food service | 71 | 20_service_food_server_servers |
63
+ | 21 | clothes - shoes - store - nordstrom - pair | 69 | 21_clothes_shoes_store_nordstrom |
64
+ | 22 | gym - classes - yoga - fitness - workout | 67 | 22_gym_classes_yoga_fitness |
65
+ | 23 | phoenix - food - durant - restaurant - good | 66 | 23_phoenix_food_durant_restaurant |
66
+ | 24 | italian - pasta - italian food - restaurant - best | 65 | 24_italian_pasta_italian food_restaurant |
67
+ | 25 | sandwich - sandwiches - bread - sacks - al | 64 | 25_sandwich_sandwiches_bread_sacks |
68
+ | 26 | airport - flight - terminal - sky harbor - harbor | 64 | 26_airport_flight_terminal_sky harbor |
69
+ | 27 | yogurt - frozen yogurt - flavors - frozen - toppings | 64 | 27_yogurt_frozen yogurt_flavors_frozen |
70
+ | 28 | nails - nail - manicure - pedicure - gel | 62 | 28_nails_nail_manicure_pedicure |
71
+ | 29 | car - auto - warranty - repair - new | 61 | 29_car_auto_warranty_repair |
72
+ | 30 | trail - hike - park - mountain - view | 60 | 30_trail_hike_park_mountain |
73
+ | 31 | dr - doctor - office - care - doctors | 58 | 31_dr_doctor_office_care |
74
+ | 32 | ice - ice cream - cream - flavors - custard | 56 | 32_ice_ice cream_cream_flavors |
75
+ | 33 | cupcakes - cupcake - cake - frosting - sprinkles | 54 | 33_cupcakes_cupcake_cake_frosting |
76
+ | 34 | wine - wines - total wine - daniel - bottle | 51 | 34_wine_wines_total wine_daniel |
77
+ | 35 | vegan - vegetarian - meat - mock - green | 45 | 35_vegan_vegetarian_meat_mock |
78
+ | 36 | stars - christopher - star - reason - pat | 45 | 36_stars_christopher_star_reason |
79
+ | 37 | staff - love place - food - great - friendly | 45 | 37_staff_love place_food_great |
80
+ | 38 | stadium - game - spring training - parking - spring | 44 | 38_stadium_game_spring training_parking |
81
+ | 39 | sub - subway - subs - jimmy - sandwich | 44 | 39_sub_subway_subs_jimmy |
82
+ | 40 | indian - indian food - buffet - india - masala | 43 | 40_indian_indian food_buffet_india |
83
+ | 41 | museum - kids - art - exhibits - exhibit | 40 | 41_museum_kids_art_exhibits |
84
+ | 42 | donuts - donut - dunkin - bosa - dunkin donuts | 40 | 42_donuts_donut_dunkin_bosa |
85
+ | 43 | fez - yelp - yelp event - event - yoli | 39 | 43_fez_yelp_yelp event_event |
86
+ | 44 | vet - dog - animals - pet - dogs | 35 | 44_vet_dog_animals_pet |
87
+ | 45 | happy hour - happy - hour - great happy - great | 35 | 45_happy hour_happy_hour_great happy |
88
+ | 46 | steak - steaks - steakhouse - good steak - sides | 34 | 46_steak_steaks_steakhouse_good steak |
89
+ | 47 | mall - stores - malls - shopping - food court | 33 | 47_mall_stores_malls_shopping |
90
+ | 48 | phone - store - iphone - camera - customer | 33 | 48_phone_store_iphone_camera |
91
+ | 49 | massage - spa - therapist - room - massages | 33 | 49_massage_spa_therapist_room |
92
+ | 50 | dog - dogs - hot dog - hot - beef | 33 | 50_dog_dogs_hot dog_hot |
93
+ | 51 | dog - pet - dog food - treats - pets | 32 | 51_dog_pet_dog food_treats |
94
+ | 52 | closed - location closed - open - closed good - business closed | 29 | 52_closed_location closed_open_closed good |
95
+ | 53 | dentist - dr - dental - teeth - office | 29 | 53_dentist_dr_dental_teeth |
96
+ | 54 | salad - lunch - sandwich - chicken - dressing | 29 | 54_salad_lunch_sandwich_chicken |
97
+ | 55 | greek - greek food - pita - gyro - greek restaurant | 27 | 55_greek_greek food_pita_gyro |
98
+ | 56 | waffles - lo - chicken waffles - chicken - lolo | 27 | 56_waffles_lo_chicken waffles_chicken |
99
+ | 57 | car - wash - car wash - job - exterior | 27 | 57_car_wash_car wash_job |
100
+ | 58 | gelato - angel sweet - angel - italy - flavors | 27 | 58_gelato_angel sweet_angel_italy |
101
+ | 59 | wings - wing - love wings - wild wings - buffalo | 26 | 59_wings_wing_love wings_wild wings |
102
+ | 60 | tea - boba - teas - drink - milk tea | 25 | 60_tea_boba_teas_drink |
103
+ | 61 | food - service - great food - great - awesome food | 25 | 61_food_service_great food_great |
104
+ | 62 | bagel - bagels - cream cheese - lox - cream | 25 | 62_bagel_bagels_cream cheese_lox |
105
+ | 63 | bruschetta - postino - wine - postinos - bottle | 24 | 63_bruschetta_postino_wine_postinos |
106
+ | 64 | review - stars - reviews - hotdog - mold | 24 | 64_review_stars_reviews_hotdog |
107
+ | 65 | foods - fresh easy - trader - easy - grocery | 22 | 65_foods_fresh easy_trader_easy |
108
+ | 66 | mongolian - mongolian bbq - yc - bowl - bbq | 22 | 66_mongolian_mongolian bbq_yc_bowl |
109
+ | 67 | service - food - time - horrible - ordered | 22 | 67_service_food_time_horrible |
110
+ | 68 | course - holes - courses - played - tee | 21 | 68_course_holes_courses_played |
111
+ | 69 | dog - dogs - park - dog park - active | 21 | 69_dog_dogs_park_dog park |
112
+ | 70 | books - book - library - bookstore - used books | 21 | 70_books_book_library_bookstore |
113
+ | 71 | pita - pita jungle - jungle - hummus - lentil | 20 | 71_pita_pita jungle_jungle_hummus |
114
+ | 72 | pasta - spaghetti - sauce - italian - bread | 20 | 72_pasta_spaghetti_sauce_italian |
115
+ | 73 | store - office max - prices - max - office | 20 | 73_store_office max_prices_max |
116
+ | 74 | expensive - good price - food - price - good food | 19 | 74_expensive_good price_food_price |
117
+ | 75 | thrift - store - goodwill - thrift store - vintage | 19 | 75_thrift_store_goodwill_thrift store |
118
+ | 76 | safeway - store - grocery - shopping - winco | 19 | 76_safeway_store_grocery_shopping |
119
+ | 77 | beer - bar - asked - minutes - trout | 18 | 77_beer_bar_asked_minutes |
120
+ | 78 | japanese - tokyo - japanese food - knife - knives | 18 | 78_japanese_tokyo_japanese food_knife |
121
+ | 79 | irish - pub - irish pub - fish chips - guinness | 16 | 79_irish_pub_irish pub_fish chips |
122
+ | 80 | works meh - friendly awesome - ing great - awesome intense - job super | 16 | 80_works meh_friendly awesome_ing great_awesome intense |
123
+ | 81 | zia - record - cd - stinkweeds - music | 15 | 81_zia_record_cd_stinkweeds |
124
+ | 82 | tires - tire - discount tire - discount - new tires | 14 | 82_tires_tire_discount tire_discount |
125
+ | 83 | cheesesteak - wiz - cheesesteaks - forefathers - philly | 14 | 83_cheesesteak_wiz_cheesesteaks_forefathers |
126
+ | 84 | korean - korean food - kimchi - bbq - dishes | 14 | 84_korean_korean food_kimchi_bbq |
127
+ | 85 | buffet - buffets - sushi - hong - hong kong | 13 | 85_buffet_buffets_sushi_hong |
128
+ | 86 | gyro - tzatziki - pita - gyros - meat | 13 | 86_gyro_tzatziki_pita_gyros |
129
+ | 87 | classes - campus - school - teacher - students | 13 | 87_classes_campus_school_teacher |
130
+ | 88 | romantic - love love - whinings excellent - whinings - live amazing | 13 | 88_romantic_love love_whinings excellent_whinings |
131
+ | 89 | patio - service - excellent service - excellent - great service | 12 | 89_patio_service_excellent service_excellent |
132
+ | 90 | staff - clean staff - clean - selection awesome - friendly | 12 | 90_staff_clean staff_clean_selection awesome |
133
+ | 91 | lux - coffee - espresso - love space - surfing | 12 | 91_lux_coffee_espresso_love space |
134
+ | 92 | wine - bottle - glass - bar - maybe | 12 | 92_wine_bottle_glass_bar |
135
+ | 93 | sushi - roll - ra - sushi bar - seated | 12 | 93_sushi_roll_ra_sushi bar |
136
+ | 94 | german - schnitzel - murphy - german food - haus | 12 | 94_german_schnitzel_murphy_german food |
137
+ | 95 | ethiopian - lalibela - injera - watt - lentils | 11 | 95_ethiopian_lalibela_injera_watt |
138
+ | 96 | store - items - michaels - susan - employee | 11 | 96_store_items_michaels_susan |
139
+
140
+ </details>
141
+
142
+ ## Training hyperparameters
143
+
144
+ * calculate_probabilities: True
145
+ * language: english
146
+ * low_memory: False
147
+ * min_topic_size: 10
148
+ * n_gram_range: (1, 1)
149
+ * nr_topics: None
150
+ * seed_topic_list: None
151
+ * top_n_words: 10
152
+ * verbose: True
153
+ * zeroshot_min_similarity: 0.7
154
+ * zeroshot_topic_list: None
155
+
156
+ ## Framework versions
157
+
158
+ * Numpy: 1.25.2
159
+ * HDBSCAN: 0.8.36
160
+ * UMAP: 0.5.6
161
+ * Pandas: 2.0.3
162
+ * Scikit-Learn: 1.2.2
163
+ * Sentence-transformers: 3.0.0
164
+ * Transformers: 4.41.1
165
+ * Numba: 0.58.1
166
+ * Plotly: 5.15.0
167
+ * Python: 3.10.12
config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": true,
14
+ "zeroshot_min_similarity": 0.7,
15
+ "zeroshot_topic_list": null,
16
+ "embedding_model": "sentence-transformers/all-MiniLM-L6-v2"
17
+ }
ctfidf.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:11cd12440a8b1bd90cfd6da02223cd3a7071fda0b7edd634e6eef782ffc27228
3
+ size 11094659
ctfidf_config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:54843059e15d369db36fdfc0d49e147e9d647c00ca6fb248f5bcc7c65e2f4a22
3
+ size 12824606
topic_embeddings.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:35863e7b3319e8ab6682d25bd19ee2249e5bdb3c3940a0c717a463a2f96534c2
3
+ size 151817
topics.json ADDED
The diff for this file is too large to render. See raw diff