Research Article

Medical Specialty Classification Based on Semiadversarial Data Augmentation

Algorithm 1

SemiADA.
Input: Medical note text , the ground truth , target model , attack step size , synonym sets size , original dataset
Output: Semiadversarial examples set
(1) ⟵ train on
(2) ⟵ Sort all words in by the descending order of their importance scores via equation (1)
(3)Filter the stopwords from
(4) ⟵ length of
(5)Fordo
 ⟵ 
(6) in ⟵ the words in where index is to
(7) ⟵ { }
(8)for in do
(9)  Initiate the candidates set by extracting the top synonyms for from WordNet using cosine similarity
(10)end for
(11)fordo
(12)   ⟵ Randomly sample words from to
(13)  Add to
(14)end for
(15)   ⟵ 
(16)for in do
(17)   ⟵ Replace to of with their corresponding candidate in
(18)  ifthen
(19)   Add to AESet
(20)    ⟵ 
(21)  end if
(22)end for
(23)if there exits whose prediction result Then
(24)  return AESet
(25)end if
(26)end for
(27)return AESet