Mechanism of Discerning Similarities in Psychiatric Diagnoses