зеркало из https://github.com/mozilla/bugbug.git
Raise NotImplementedError in get_distance methods of Similarity models that don't implement it yet (#805)
This commit is contained in:
Родитель
88b754261e
Коммит
7afccd64b9
|
@ -207,6 +207,9 @@ class LSISimilarity(BaseSimilarity):
|
|||
# Get IDs of the k most similar bugs
|
||||
return [self.corpus[j[0]][0] for j in sims[:k]]
|
||||
|
||||
def get_distance(self, query1, query2):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class NeighborsSimilarity(BaseSimilarity):
|
||||
def __init__(
|
||||
|
@ -238,6 +241,9 @@ class NeighborsSimilarity(BaseSimilarity):
|
|||
self.bug_ids[ind] for ind in indices[0] if self.bug_ids[ind] != query["id"]
|
||||
]
|
||||
|
||||
def get_distance(self, query1, query2):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class Word2VecWmdSimilarity(BaseSimilarity):
|
||||
def __init__(self, cut_off=0.2, cleanup_urls=True, nltk_tokenizer=False):
|
||||
|
|
Загрузка…
Ссылка в новой задаче