Exemplo n.º 1
0
 def __init__(self, ans, phrasing):
     self.answer = ans
     sim0 = semantic_similarity(ans, phrasing[0])
     sim1 = semantic_similarity(ans, phrasing[-1])
     if sim0 > sim1:
         self.definition = phrasing[0]
     else:
         self.definition = phrasing[1]
     self.similarity = max(sim0, sim1)
     self.clue = "???"
Exemplo n.º 2
0
 def __init__(self, ans, phrasing):
     self.answer = ans
     sim0 = semantic_similarity(ans, phrasing[0])
     sim1 = semantic_similarity(ans, phrasing[-1])
     if sim0 > sim1:
         self.definition = phrasing[0]
     else:
         self.definition = phrasing[1]
     self.similarity = max(sim0, sim1)
     self.clue = "???"
Exemplo n.º 3
0
 def __init__(self, ans, clue):
     self.answer = ans
     self.clue = clue
     d_tree = clue[[x.node for x in clue].index('d')]
     self.definition = d_tree[0]
     self.similarity = semantic_similarity(self.answer, self.definition)
Exemplo n.º 4
0
 def __init__(self, ans, clue):
     self.answer = ans
     self.clue = clue
     d_tree = clue[[x.node for x in clue].index('d')]
     self.definition = d_tree[0]
     self.similarity = semantic_similarity(self.answer, self.definition)
Exemplo n.º 5
0
 def __init__(self, ans, clue):
     self.answer = ans.encode('ascii', 'replace')
     self.clue = clue
     d_tree = clue[[x.node.name for x in clue].index('d')]
     self.definition = d_tree[0]
     self.similarity = semantic_similarity(self.answer, self.definition)