-
Notifications
You must be signed in to change notification settings - Fork 3
/
dataset_handler.py
255 lines (241 loc) · 12.9 KB
/
dataset_handler.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 4 Feb 2022
@author: Duncan C McElfresh
code for iterating over each dataset
"""
# multiple amazon reviewdata readers
from Data_manager.AmazonReviewData.AmazonAllBeautyReader import AmazonAllBeautyReader
from Data_manager.AmazonReviewData.AmazonAllCreditCardsReader import AmazonAllCreditCardsReader
from Data_manager.AmazonReviewData.AmazonAllElectronicsReader import AmazonAllElectronicsReader
from Data_manager.AmazonReviewData.AmazonAlternativeRockReader import AmazonAlternativeRockReader
from Data_manager.AmazonReviewData.AmazonAmazonCoinsReader import AmazonAmazonCoinsReader
from Data_manager.AmazonReviewData.AmazonAmazonFashionReader import AmazonAmazonFashionReader
from Data_manager.AmazonReviewData.AmazonAmazonFireTVReader import AmazonAmazonFireTVReader
from Data_manager.AmazonReviewData.AmazonAmazonInstantVideoReader import AmazonAmazonInstantVideoReader
from Data_manager.AmazonReviewData.AmazonAppliancesReader import AmazonAppliancesReader
from Data_manager.AmazonReviewData.AmazonAppsforAndroidReader import AmazonAppsforAndroidReader
from Data_manager.AmazonReviewData.AmazonAppstoreforAndroidReader import AmazonAppstoreforAndroidReader
from Data_manager.AmazonReviewData.AmazonArtsCraftsSewingReader import AmazonArtsCraftsSewingReader
from Data_manager.AmazonReviewData.AmazonAutomotiveReader import AmazonAutomotiveReader
from Data_manager.AmazonReviewData.AmazonBabyReader import AmazonBabyReader
from Data_manager.AmazonReviewData.AmazonBabyProductsReader import AmazonBabyProductsReader
from Data_manager.AmazonReviewData.AmazonBeautyReader import AmazonBeautyReader
from Data_manager.AmazonReviewData.AmazonBluesReader import AmazonBluesReader
from Data_manager.AmazonReviewData.AmazonBooksReader import AmazonBooksReader
from Data_manager.AmazonReviewData.AmazonBroadwayVocalistsReader import AmazonBroadwayVocalistsReader
from Data_manager.AmazonReviewData.AmazonBuyaKindleReader import AmazonBuyaKindleReader
from Data_manager.AmazonReviewData.AmazonCDsVinylReader import AmazonCDsVinylReader
from Data_manager.AmazonReviewData.AmazonCameraPhotoReader import AmazonCameraPhotoReader
from Data_manager.AmazonReviewData.AmazonCarElectronicsReader import AmazonCarElectronicsReader
from Data_manager.AmazonReviewData.AmazonCelebrateyourBirthdaywithNickelodeonReader import AmazonCelebrateyourBirthdaywithNickelodeonReader
from Data_manager.AmazonReviewData.AmazonCellPhonesAccessoriesReader import AmazonCellPhonesAccessoriesReader
from Data_manager.AmazonReviewData.AmazonChildrensMusicReader import AmazonChildrensMusicReader
from Data_manager.AmazonReviewData.AmazonChristianReader import AmazonChristianReader
from Data_manager.AmazonReviewData.AmazonClassicRockReader import AmazonClassicRockReader
from Data_manager.AmazonReviewData.AmazonClassicalReader import AmazonClassicalReader
from Data_manager.AmazonReviewData.AmazonClothingShoesJewelryReader import AmazonClothingShoesJewelryReader
from Data_manager.AmazonReviewData.AmazonCollectibleCoinsReader import AmazonCollectibleCoinsReader
from Data_manager.AmazonReviewData.AmazonCollectiblesFineArtReader import AmazonCollectiblesFineArtReader
from Data_manager.AmazonReviewData.AmazonComputersReader import AmazonComputersReader
from Data_manager.AmazonReviewData.AmazonCountryReader import AmazonCountryReader
from Data_manager.AmazonReviewData.AmazonDanceElectronicReader import AmazonDanceElectronicReader
from Data_manager.AmazonReviewData.AmazonDavisReader import AmazonDavisReader
from Data_manager.AmazonReviewData.AmazonDigitalMusicReader import AmazonDigitalMusicReader
from Data_manager.AmazonReviewData.AmazonElectronicsReader import AmazonElectronicsReader
from Data_manager.AmazonReviewData.AmazonEntertainmentReader import AmazonEntertainmentReader
from Data_manager.AmazonReviewData.AmazonFolkReader import AmazonFolkReader
from Data_manager.AmazonReviewData.AmazonFurnitureDecorReader import AmazonFurnitureDecorReader
from Data_manager.AmazonReviewData.AmazonGPSNavigationReader import AmazonGPSNavigationReader
from Data_manager.AmazonReviewData.AmazonGiftCardsReader import AmazonGiftCardsReader
from Data_manager.AmazonReviewData.AmazonGiftCardsStoreReader import AmazonGiftCardsStoreReader
from Data_manager.AmazonReviewData.AmazonGospelReader import AmazonGospelReader
from Data_manager.AmazonReviewData.AmazonGroceryGourmetFoodReader import AmazonGroceryGourmetFoodReader
from Data_manager.AmazonReviewData.AmazonHardRockMetalReader import AmazonHardRockMetalReader
from Data_manager.AmazonReviewData.AmazonHealthPersonalCareReader import AmazonHealthPersonalCareReader
from Data_manager.AmazonReviewData.AmazonHomeImprovementReader import AmazonHomeImprovementReader
from Data_manager.AmazonReviewData.AmazonHomeKitchenReader import AmazonHomeKitchenReader
from Data_manager.AmazonReviewData.AmazonIndustrialScientificReader import AmazonIndustrialScientificReader
from Data_manager.AmazonReviewData.AmazonInternationalReader import AmazonInternationalReader
from Data_manager.AmazonReviewData.AmazonJazzReader import AmazonJazzReader
from Data_manager.AmazonReviewData.AmazonKindleStoreReader import AmazonKindleStoreReader
from Data_manager.AmazonReviewData.AmazonKitchenDiningReader import AmazonKitchenDiningReader
from Data_manager.AmazonReviewData.AmazonLatinMusicReader import AmazonLatinMusicReader
from Data_manager.AmazonReviewData.AmazonLearningEducationReader import AmazonLearningEducationReader
from Data_manager.AmazonReviewData.AmazonLuxuryBeautyReader import AmazonLuxuryBeautyReader
from Data_manager.AmazonReviewData.AmazonMP3PlayersAccessoriesReader import AmazonMP3PlayersAccessoriesReader
from Data_manager.AmazonReviewData.AmazonMagazineSubscriptionsReader import AmazonMagazineSubscriptionsReader
from Data_manager.AmazonReviewData.AmazonMicrosoftReader import AmazonMicrosoftReader
from Data_manager.AmazonReviewData.AmazonMiscellaneousReader import AmazonMiscellaneousReader
from Data_manager.AmazonReviewData.AmazonMoviesTVReader import AmazonMoviesTVReader
from Data_manager.AmazonReviewData.AmazonMusicalInstrumentsReader import AmazonMusicalInstrumentsReader
from Data_manager.AmazonReviewData.AmazonNewAgeReader import AmazonNewAgeReader
from Data_manager.AmazonReviewData.AmazonNickelodeonReader import AmazonNickelodeonReader
from Data_manager.AmazonReviewData.AmazonOfficeProductsReader import AmazonOfficeProductsReader
from Data_manager.AmazonReviewData.AmazonOfficeSchoolSuppliesReader import AmazonOfficeSchoolSuppliesReader
from Data_manager.AmazonReviewData.AmazonPatioLawnGardenReader import AmazonPatioLawnGardenReader
from Data_manager.AmazonReviewData.AmazonPetSuppliesReader import AmazonPetSuppliesReader
from Data_manager.AmazonReviewData.AmazonPopReader import AmazonPopReader
from Data_manager.AmazonReviewData.AmazonPublishersReader import AmazonPublishersReader
from Data_manager.AmazonReviewData.AmazonPurchaseCirclesReader import AmazonPurchaseCirclesReader
from Data_manager.AmazonReviewData.AmazonRBReader import AmazonRBReader
from Data_manager.AmazonReviewData.AmazonRapHipHopReader import AmazonRapHipHopReader
from Data_manager.AmazonReviewData.AmazonRockReader import AmazonRockReader
from Data_manager.AmazonReviewData.AmazonSoftwareReader import AmazonSoftwareReader
from Data_manager.AmazonReviewData.AmazonSportsCollectiblesReader import AmazonSportsCollectiblesReader
from Data_manager.AmazonReviewData.AmazonSportsOutdoorsReader import AmazonSportsOutdoorsReader
from Data_manager.AmazonReviewData.AmazonToolsHomeImprovementReader import AmazonToolsHomeImprovementReader
from Data_manager.AmazonReviewData.AmazonToysGamesReader import AmazonToysGamesReader
from Data_manager.AmazonReviewData.AmazonVideoGamesReader import AmazonVideoGamesReader
from Data_manager.AmazonReviewData.AmazonWineReader import AmazonWineReader
# multiple movielens readers
from Data_manager.Movielens.Movielens100KReader import Movielens100KReader
from Data_manager.Movielens.Movielens1MReader import Movielens1MReader
from Data_manager.Movielens.Movielens10MReader import Movielens10MReader
from Data_manager.Movielens.Movielens20MReader import Movielens20MReader
from Data_manager.Movielens.MovielensHetrec2011Reader import MovielensHetrec2011Reader
# everything else!
from Data_manager.BookCrossing.BookCrossingReader import BookCrossingReader
from Data_manager.Dating.DatingReader import DatingReader
from Data_manager.Epinions.EpinionsReader import EpinionsReader
from Data_manager.FilmTrust.FilmTrustReader import FilmTrustReader
from Data_manager.Frappe.FrappeReader import FrappeReader
from Data_manager.Gowalla.GowallaReader import GowallaReader
from Data_manager.Jester2.Jester2Reader import Jester2Reader
from Data_manager.MarketBiasAmazon.MarketBiasAmazonReader import MarketBiasAmazonReader
from Data_manager.MarketBiasModCloth.MarketBiasModClothReader import (
MarketBiasModClothReader,
)
from Data_manager.MovieTweetings.MovieTweetingsReader import MovieTweetingsReader
from Data_manager.NetflixPrize.NetflixPrizeReader import NetflixPrizeReader
from Data_manager.Recipes.RecipesReader import RecipesReader
from Data_manager.Wikilens.WikilensReader import WikilensReader
from Data_manager.Anime.AnimeReader import AnimeReader
from Data_manager.CiaoDVD.CiaoDVDReader import CiaoDVDReader
from Data_manager.GoogleLocalReviews.GoogleLocalReviewsReader import GoogleLocalReviewsReader
from Data_manager.LastFM.LastFMReader import LastFMReader
from Data_manager.YahooMusic.YahooMusicReader import YahooMusicReader
from Data_manager.YahooMovies.YahooMoviesReader import YahooMoviesReader
DATASET_READER_LIST = [
AmazonAllBeautyReader,
AmazonAllCreditCardsReader,
AmazonAllElectronicsReader,
AmazonAlternativeRockReader,
AmazonAmazonCoinsReader,
AmazonAmazonFashionReader,
AmazonAmazonFireTVReader,
AmazonAmazonInstantVideoReader,
AmazonAppliancesReader,
AmazonAppsforAndroidReader,
AmazonAppstoreforAndroidReader,
AmazonArtsCraftsSewingReader,
AmazonAutomotiveReader,
AmazonBabyReader,
AmazonBabyProductsReader,
AmazonBeautyReader,
AmazonBluesReader,
AmazonBooksReader,
AmazonBroadwayVocalistsReader,
AmazonBuyaKindleReader,
AmazonCDsVinylReader,
AmazonCameraPhotoReader,
AmazonCarElectronicsReader,
AmazonCelebrateyourBirthdaywithNickelodeonReader,
AmazonCellPhonesAccessoriesReader,
AmazonChildrensMusicReader,
AmazonChristianReader,
AmazonClassicRockReader,
AmazonClassicalReader,
AmazonClothingShoesJewelryReader,
AmazonCollectibleCoinsReader,
AmazonCollectiblesFineArtReader,
AmazonComputersReader,
AmazonCountryReader,
AmazonDanceElectronicReader,
AmazonDavisReader,
AmazonDigitalMusicReader,
AmazonElectronicsReader,
AmazonEntertainmentReader,
AmazonFolkReader,
AmazonFurnitureDecorReader,
AmazonGPSNavigationReader,
AmazonGiftCardsReader,
AmazonGiftCardsStoreReader,
AmazonGospelReader,
AmazonGroceryGourmetFoodReader,
AmazonHardRockMetalReader,
AmazonHealthPersonalCareReader,
AmazonHomeImprovementReader,
AmazonHomeKitchenReader,
AmazonIndustrialScientificReader,
AmazonInternationalReader,
AmazonJazzReader,
AmazonKindleStoreReader,
AmazonKitchenDiningReader,
AmazonLatinMusicReader,
AmazonLearningEducationReader,
AmazonLuxuryBeautyReader,
AmazonMP3PlayersAccessoriesReader,
AmazonMagazineSubscriptionsReader,
AmazonMicrosoftReader,
AmazonMiscellaneousReader,
AmazonMoviesTVReader,
AmazonMusicalInstrumentsReader,
AmazonNewAgeReader,
AmazonNickelodeonReader,
AmazonOfficeProductsReader,
AmazonOfficeSchoolSuppliesReader,
AmazonPatioLawnGardenReader,
AmazonPetSuppliesReader,
AmazonPopReader,
AmazonPublishersReader,
AmazonPurchaseCirclesReader,
AmazonRBReader,
AmazonRapHipHopReader,
AmazonRockReader,
AmazonSoftwareReader,
AmazonSportsCollectiblesReader,
AmazonSportsOutdoorsReader,
AmazonToolsHomeImprovementReader,
AmazonToysGamesReader,
AmazonVideoGamesReader,
AmazonWineReader,
Movielens100KReader,
Movielens1MReader,
Movielens10MReader,
Movielens20MReader,
MovielensHetrec2011Reader,
BookCrossingReader,
DatingReader,
EpinionsReader,
FilmTrustReader,
FrappeReader,
GowallaReader,
Jester2Reader,
MarketBiasAmazonReader,
MarketBiasModClothReader,
MovieTweetingsReader,
NetflixPrizeReader,
RecipesReader,
WikilensReader,
AnimeReader,
CiaoDVDReader,
GoogleLocalReviewsReader,
LastFMReader,
YahooMusicReader,
YahooMoviesReader
]
DATASET_READER_NAME_LIST = [c.__name__ for c in DATASET_READER_LIST]
DATASET_DICT = {
name: c for name, c in zip(DATASET_READER_NAME_LIST, DATASET_READER_LIST)
}
def dataset_handler(dataset_reader_name):
"""
Returns:
- dataset reader object
"""
assert (
dataset_reader_name in DATASET_READER_NAME_LIST
), f"dataset reader name not recognized: {dataset_reader_name}"
return DATASET_DICT[dataset_reader_name]