implement topic_similarity.py