modify getSimilarity.py as a function to be imported.