(self, path_vid, wv_from_text)
| 536 | |
| 537 | class Title_W2V_Dataset(Dataset): |
| 538 | def __init__(self, path_vid, wv_from_text): |
| 539 | self.data_complete = pd.read_json('./data/data.json',orient='records',dtype=False,lines=True) |
| 540 | |
| 541 | self.vid = [] |
| 542 | with open('./data/vids/'+path_vid, "r") as fr: |
| 543 | for line in fr.readlines(): |
| 544 | self.vid.append(line.strip()) |
| 545 | self.data = self.data_complete[self.data_complete.video_id.isin(self.vid)] |
| 546 | self.data['video_id'] = self.data['video_id'].astype('category') |
| 547 | self.data['video_id'].cat.set_categories(self.vid, inplace=True) |
| 548 | self.data.sort_values('video_id', ascending=True, inplace=True) |
| 549 | self.data.reset_index(inplace=True) |
| 550 | |
| 551 | self.wv_from_text = wv_from_text |
| 552 | |
| 553 | def __len__(self): |
| 554 | return self.data.shape[0] |
nothing calls this directly
no outgoing calls
no test coverage detected