Exemplo n.º 1
0
class TagrelSearchEngine (TagBasedSearchEngine):
    def __init__(self, collection, dataset, tagrelMethod, tpp='lemm', rootpath=ROOT_PATH):
        TagBasedSearchEngine.__init__(self, collection, dataset, tpp, rootpath)
        self.reader = TagrelReader(collection, dataset, tagrelMethod, nonnegative=0, rootpath=rootpath)
        self.name = "%s(%s)" % (self.__class__.__name__, self.reader.name)
        self.outputdir = os.path.join(self.outputdir, tagrelMethod)
        
    def computeScore(self, concept, photoid):
        return self.reader.get(photoid, concept)
class TagrelSearchEngine(TagBasedSearchEngine):
    def __init__(self,
                 collection,
                 dataset,
                 tagrelMethod,
                 tpp='lemm',
                 rootpath=ROOT_PATH):
        TagBasedSearchEngine.__init__(self, collection, dataset, tpp, rootpath)
        self.reader = TagrelReader(collection,
                                   dataset,
                                   tagrelMethod,
                                   nonnegative=0,
                                   rootpath=rootpath)
        self.name = "%s(%s)" % (self.__class__.__name__, self.reader.name)
        self.outputdir = os.path.join(self.outputdir, tagrelMethod)

    def computeScore(self, concept, photoid):
        return self.reader.get(photoid, concept)