Research Article

Doctor Recommendation Model Based on Ontology Characteristics and Disease Text Mining Perspective

Algorithm 3

The module mainly had two goals to achieve. First, preprocess the test data, including word segmentation and stop word removal, and retaining key parts or symptoms for the disease description. Second, compare the word vectors of test data and that of the training results, and the departments with high similarity were recommended to patients.
  The code is as the follows:
   #Note: Load the department’s word vector model
   model_1 = word2vec.Word2Vec.load(“pifuke.model”)
   for strZhengZhuang in symptom word set of a certain patient
    try:
      sim3 = model_1.most_similar(strZhengZhuang,topn =20)
      if sim3.__len__() >0:
       return 1
    except:
      return 0
   #Note: Number of matching words/total number of symptom words for a patient = Matching probability
   probability = Words/WordsCount