An automatic annotating method for subjects of open source software comprises the steps as follows: open source project data is obtained, project labels are converted to roots of the project labels, then the labels of the identical roots are merged, and project descriptions are converted to word packets; names, the labels and the project descriptions of an open source project are taken as input, annotated LDA (Latent Dirichlet Allocation) models are applied, the input data is trained through a Gibbs sampling process, all labels and counts designated by certain words in the project descriptions are obtained after stabilization, and words are generated in label designation; a label network is constructed in the label designation according to the generated words, and semantic distances and semantic cohesion of points are calculated; in addition, a new project can be annotated automatically according to the constructed label network, the name and the description of any one project p are input, each word in the description is searched in the label network, respective label sets Li of each different word i in the description are obtained, one label 1i is selected from each Li, the semantic cohesion (Cohesion L) can be maximum, and the labels satisfying the conditions are annotated to the new project automatically.