예제 #1
0
 def precompute_annotator(self, concept):
     NegativeEngine.precompute_annotator(self, concept)
     for subconcept in concept.split('-'):
         expandedTagSet = set([subconcept] + wn_expand(subconcept))
         self.annotator = self.annotator.union(expandedTagSet)
     INFO = 'dataengine.%s' % self.__class__.__name__
     printStatus(INFO, 'precomputing the virtual annotator for %s: %d tags' % (concept, len(self.annotator)))
예제 #2
0
 def precompute_annotator(self, concept):
     NegativeEngine.precompute_annotator(self, concept)
     for subconcept in concept.split('-'):
         expandedTagSet = set([subconcept] + wn_expand(subconcept))
         self.annotator = self.annotator.union(expandedTagSet)
     INFO = 'dataengine.%s' % self.__class__.__name__
     printStatus(
         INFO, 'precomputing the virtual annotator for %s: %d tags' %
         (concept, len(self.annotator)))
예제 #3
0
 def precompute_annotator(self, concept):
     INFO = 'dataengine.%s.precompute_annotator'%self.__class__.__name__
     topn = 100
     NegativeEngine.precompute_annotator(self, concept)
     
     for subconcept in concept.split('-'):
         expandedTagSet = set([subconcept] + wn_expand(subconcept))
         try:
             datafile = os.path.join(ROOT_PATH, self.collection, 'SimilarityIndex', 'ngd', '%s.txt' % subconcept)
             rankedtags = readRankingResults(datafile)
             expandedTagSet = expandedTagSet.union(set([x[0] for x in rankedtags[:topn]]))
         except:
             printError(INFO, 'failed to load ranktag file for %s' % subconcept)
         self.annotator = self.annotator.union(expandedTagSet)
     printStatus(INFO, 'precomputing the virtual annotator for %s: %d tags' % (concept, len(self.annotator)))
예제 #4
0
    def precompute_annotator(self, concept):
        INFO = 'dataengine.%s.precompute_annotator' % self.__class__.__name__
        topn = 100
        NegativeEngine.precompute_annotator(self, concept)

        for subconcept in concept.split('-'):
            expandedTagSet = set([subconcept] + wn_expand(subconcept))
            try:
                datafile = os.path.join(ROOT_PATH, self.collection,
                                        'SimilarityIndex', 'ngd',
                                        '%s.txt' % subconcept)
                rankedtags = readRankingResults(datafile)
                expandedTagSet = expandedTagSet.union(
                    set([x[0] for x in rankedtags[:topn]]))
            except:
                printError(INFO,
                           'failed to load ranktag file for %s' % subconcept)
            self.annotator = self.annotator.union(expandedTagSet)
        printStatus(
            INFO, 'precomputing the virtual annotator for %s: %d tags' %
            (concept, len(self.annotator)))