def overlap(r1, r2): return text.overlap(r1["title"], r2["title"]) > 1
def overlap_predicate(r1, r2): return text.overlap(r1["title"], r2["title"]) > 2
def rankf(row): row.update( {"rank": text.overlap(row["yn$abstract"], row["wiki$summary"]["value"])} ) ; return row