Raise NotImplementedError in get_distance methods of Similarity models that don't implement it yet (#805)

This commit is contained in:
Ayush Shridhar 2019-07-29 14:07:36 +01:00 коммит произвёл Marco
Родитель 88b754261e
Коммит 7afccd64b9
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -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):