Similarity calculation is an important part of natural language processing. The higher the accuracy of the similarity, the better the results for downstream tasks. In previous studies, similarity was calculated using a single knowledge source and the similarity calculation was not satisfactory. Later, computing similarity combining multiple knowledge sources can lead to better similarity computation results. In this paper, we calculate similarity based on multiple knowledge sources and use the simulated annealing algorithm to calculate the damping factor between different knowledge sources to obtain the composite similarity. The error between the composite similarity values of the BioBERT model and the Word2Vec model and the standard similarity values is only 0.03. In the data of the official similarity calculation, the composite similarity can improve the accuracy of the similarity very well.