MCPcopy Create free account
hub / github.com/ICTMCG/FakeSV / __init__

Method __init__

code/utils/dataloader.py:538–551  ·  view source on GitHub ↗
(self, path_vid, wv_from_text)

Source from the content-addressed store, hash-verified

536
537class 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]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected