Ejemplo n.º 1
0
def score(q, a):
    if a not in WA:
        warning('I have not seen ' + str(a) + ' before.')
        return -float('inf')
    #print([W[w] for w in q.split()], WA[a])
    ql = [W[w] for w in q.split()]
    a = WA[a]
    return qae.s(*([a] + ql))
 def score(self, q, a, path=False):
     if not path:
         a = self.key[a]
     if a not in self.WA:
         warning('I have not seen' + str(a) + 'before.')
         return -float('inf')
     #print([self.W[w] for w in q.split()], self.WA[a])
     ql = [self.W[w] for w in q.split()]
     a = self.WA[a]
     return qae.s(*([a] + ql))
Ejemplo n.º 3
0
 def score(self, q, a, path=False):
     if not path:
         a = self.key[a]
     if a not in self.WA:
         warning('I have not seen' + str(a) + 'before.')
         return -float('inf')
     #print([self.W[w] for w in q.split()], self.WA[a])
     ql = [self.W[w] for w in q.split()]
     a = self.WA[a]
     return qae.s(*([a] + ql))