File size: 612 Bytes
fda57dd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
"""
Get similarities of similar and dissimilar pairs.
The values are used for normalizing the colors in the visualization.
"""
from app import load_pipeline
from recognizers import DiffAlign, DiffDel
similar_pair = ("Hello!", "Hi!")
dissimilar_pair = ("Hello!", "asdf")
pipeline = load_pipeline()
diff_align = DiffAlign(pipeline=pipeline)
diff_del = DiffDel(pipeline=pipeline)
print("Similar pair:")
print(diff_align.predict(*similar_pair).min)
print(diff_del.predict(*similar_pair).min)
print("Dissimilar pair:")
print(diff_align.predict(*dissimilar_pair).max)
print(diff_del.predict(*dissimilar_pair).max)
|