Esempio n. 1
0
    def emb(self, routee, dest):
        """

        :param routee: 
        :param dest: 
        :return: Some kind of vector, you choose 
        """
        return [cosine_similarity(routee['v'], dest['v'])]
Esempio n. 2
0
    def word_sim(self, routee, dest):
        """

        :param routee: 
        :param dest: 
        :return: Some kind of vector, you choose 
        """
        cosine = cosine_similarity(routee['t'], (dest['t']))
        return cosine
Esempio n. 3
0
    def emb(self, routee, dest):
        """

        :param routee: 
        :param dest: 
        :return: Some kind of vector, you choose 
        """
        cosine = cosine_similarity(routee['ca'], dest['ca'])
        overlap = self.coauthor_overlap(routee, dest)
        clo = self.coauthor_last_overlap(routee, dest)
        return [cosine, overlap, clo]
Esempio n. 4
0
    def emb(self, routee, dest):
        """

        :param routee: 
        :param dest: 
        :return: Some kind of vector, you choose 
        """
        # cosine = cosine_similarity(routee['r'], (dest['r']))
        # if self.config.use_cuda:
        #     return Variable(torch.cuda.FloatTensor([cosine]))
        # else:
        #     return Variable(torch.FloatTensor([cosine]))
        return [cosine_similarity(routee['r'], dest['r'])]
Esempio n. 5
0
 def venue_cossim(self, m1, m2):
     return cosine_similarity(m1['vw'], m2['vw'])