Ejemplo n.º 1
0
 def __init__(self):
     self.graph_def = None
     if hasattr(self, 'labels_path') and self.labels_path is not None:
         self.labels = load(self.labels_path, split=True)
     if hasattr(self, 'synsets_path') and self.synsets_path is not None:
         self.synset_ids = load(self.synsets_path, split=True)
         self.synsets = [synset_from_id(id) for id in self.synset_ids]
Ejemplo n.º 2
0
    def synsets(self):
        from lucid.modelzoo.wordnet import synset_from_id

        if not self._synsets:
            self._synsets = [synset_from_id(s_id) for s_id in self.synset_ids]
        return self._synsets
Ejemplo n.º 3
0
 def synsets(self):
     if not self._synsets:
         self._synsets = [synset_from_id(s_id) for s_id in self.synset_ids]
     return self._synsets
Ejemplo n.º 4
0
def test_synset_from_id(synset_id, synset):
    result = synset_from_id(synset_id)
    assert result == synset