from common.linkers.orderedLinker import OrderedLinker


class RelationOrderedLinker(OrderedLinker):

    def __init__(self, candidate_generator, sorters, vocab,
        include_similarity_score=True):
        super(RelationOrderedLinker, self).__init__(candidate_generator,
            sorters, vocab, include_similarity_score)

    def best_ranks(self, surfaces, extra_surfaces, qa_row, k, train,
        extra_candidates=None):
        results = super(RelationOrderedLinker, self).best_ranks(surfaces,
            extra_surfaces, qa_row.sparql.relations, qa_row.question, k,
            train, extra_candidates)
        self.logger.debug([' '.join(item) for item in surfaces])
        self.logger.debug([rel.raw_uri for rel in qa_row.sparql.relations])
        self.logger.debug(list(map('{:0.2f}'.format, results[1:-1])))
        return results

    def ranked_link(self, surfaces, extra_surfaces, question, k,
        extra_candidates=None):
        results = super(RelationOrderedLinker, self).ranked_link(surfaces,
            extra_surfaces, question, k, extra_candidates)
        return results

f39847ecd7a77502f1d594e18ba9dfc34eebe704
<mask token>

<mask token>


class RelationOrderedLinker(OrderedLinker):
    <mask token>

    def best_ranks(self, surfaces, extra_surfaces, qa_row, k, train,
        extra_candidates=None):
        results = super(RelationOrderedLinker, self).best_ranks(surfaces,
            extra_surfaces, qa_row.sparql.relations, qa_row.question, k,
            train, extra_candidates)
        self.logger.debug([' '.join(item) for item in surfaces])
        self.logger.debug([rel.raw_uri for rel in qa_row.sparql.relations])
        self.logger.debug(list(map('{:0.2f}'.format, results[1:-1])))
        return results

    def ranked_link(self, surfaces, extra_surfaces, question, k,
        extra_candidates=None):
        results = super(RelationOrderedLinker, self).ranked_link(surfaces,
            extra_surfaces, question, k, extra_candidates)
        return results

<mask token>


class RelationOrderedLinker(OrderedLinker):

    def __init__(self, candidate_generator, sorters, vocab,
        include_similarity_score=True):
        super(RelationOrderedLinker, self).__init__(candidate_generator,
            sorters, vocab, include_similarity_score)

    def best_ranks(self, surfaces, extra_surfaces, qa_row, k, train,
        extra_candidates=None):
        results = super(RelationOrderedLinker, self).best_ranks(surfaces,
            extra_surfaces, qa_row.sparql.relations, qa_row.question, k,
            train, extra_candidates)
        self.logger.debug([' '.join(item) for item in surfaces])
        self.logger.debug([rel.raw_uri for rel in qa_row.sparql.relations])
        self.logger.debug(list(map('{:0.2f}'.format, results[1:-1])))
        return results

    def ranked_link(self, surfaces, extra_surfaces, question, k,
        extra_candidates=None):
        results = super(RelationOrderedLinker, self).ranked_link(surfaces,
            extra_surfaces, question, k, extra_candidates)
        return results

from common.linkers.orderedLinker import OrderedLinker


class RelationOrderedLinker(OrderedLinker):

    def __init__(self, candidate_generator, sorters, vocab,
        include_similarity_score=True):
        super(RelationOrderedLinker, self).__init__(candidate_generator,
            sorters, vocab, include_similarity_score)

    def best_ranks(self, surfaces, extra_surfaces, qa_row, k, train,
        extra_candidates=None):
        results = super(RelationOrderedLinker, self).best_ranks(surfaces,
            extra_surfaces, qa_row.sparql.relations, qa_row.question, k,
            train, extra_candidates)
        self.logger.debug([' '.join(item) for item in surfaces])
        self.logger.debug([rel.raw_uri for rel in qa_row.sparql.relations])
        self.logger.debug(list(map('{:0.2f}'.format, results[1:-1])))
        return results

    def ranked_link(self, surfaces, extra_surfaces, question, k,
        extra_candidates=None):
        results = super(RelationOrderedLinker, self).ranked_link(surfaces,
            extra_surfaces, question, k, extra_candidates)
        return results
