Exemple #1
0
    def get_best_candid(self, wname):
        wtext = wiki.getArticleText(wname)
        #candids = self.get_brit_candids_from_wiki_candids(wname)
        candids = self.get_all_candids(wname)
        indeces = []
        
        c = 0
        for art in self.arts:
            if str(art['name']) in candids:
                indeces.insert(candids.index(art['name']),c)
            c+=1

        c = 0
        title_texts = []
        while c < 2:
            for i in xrange(indeces[c], indeces[c+1]+1):
                title_texts.append((self.arts[i]['name'], self.arts[i]['txt']))
            c+=2
            
        occp = loadOccupations()

        scandids = a_m.getCombinedScores(wtext, title_texts, FN, occp)
        if scandids == []:
            return None

        return scandids[0]
Exemple #2
0
    def get_best_candid(self, wname):
        candids = self.get_candids(wname)
        wtext = wiki.getArticleText(wname)
        
        title_texts = []
        for art in candids:
                title_texts.append((art['name'], art['txt']))

        scandids = a_m.getCombinedScores(wtext, title_texts, self.fn, self.occp, vt=True)
        if scandids == []:
            return None

        return scandids[0]