def __getitem__(self, item)->datasets.PredictionItem: X=data0[item] y1=np.zeros(168) y1[gr[item]]=1 y2=np.zeros(11) y2[vd[item]]=1 y3=np.zeros(7) y3[cd[item]]=1 return datasets.PredictionItem(item,np.stack([X],axis=-1),[y1,y2,y3])
def __getitem__(self, item) -> datasets.PredictionItem: tokenText = [] tokenClazz = [] if self.byDoc: d = self.docs[item] for sent in d.sentences: tokenText = tokenText + [x.text for x in sent.tokens] tokenClazz = tokenClazz + [ self.num2Class[self.clazzColumn][0][x.fields[ self.clazzColumn]] for x in sent.tokens ] else: sent = self.sentences[item] tokenText = tokenText + [x.text for x in sent.tokens] tokenClazz = tokenClazz + [ self.num2Class[self.clazzColumn][0][x.fields[self.clazzColumn]] for x in sent.tokens ] return datasets.PredictionItem(item, np.array(tokenText), np.array(tokenClazz))
def __getitem__(self, item) -> datasets.PredictionItem: return datasets.PredictionItem( self.sorted[item][0], self.sorted[item][0], (self.sorted[item][1], "count:" + str(self.sorted[item][2])))
def __getitem__(self, item) -> datasets.PredictionItem: return datasets.PredictionItem(self.sorted[item][0], self.sorted[item][0], self.sorted[item][1])
def __getitem__(self, item): return datasets.PredictionItem( item, "H", (np.array([item % 2, item % 3])))
def __getitem__(self, item): return datasets.PredictionItem(item, "H", ([item % 2], [item % 3]))
def __getitem__(self, item): if item == 2: raise ValueError() return datasets.PredictionItem(item, "H", 0)
def __getitem__(self, item): return datasets.PredictionItem(item, "H", (np.array( [float(item % 2), float(item % 3)])))
def __getitem__(self, item): return datasets.PredictionItem(item, self.get_questions(item), np.array([self.target[item]]))
def __getitem__(self, item): return datasets.PredictionItem(item, self.src[item], self.dest[item])