Similarity#

tensor_theorem_prover.cosine_similarity(item1, item2)[source]#

use cosine similarity to calculate a similarity score between the items. falls back to symbol comparison if either item is missing a embedding

tensor_theorem_prover.symbol_compare(item1, item2)[source]#

directly compares the symbol strings of the two items, doesn’t do any fuzzy matching

tensor_theorem_prover.max_similarity(funcs)[source]#

returns a function that calls all the given functions and returns the maximum similarity score