Automatic classification of texts is a well-known topic in natural language processing (NLP), and it involves categorizing unstructured texts into specific groups. Classification algorithms for a given problem are searched for, as well as the appropriate features to use as input. These models have been used for analysis of data with a large number of sparse dimensions. In medical field, categorization of medical texts is a difficult task because these types of texts contain several terminologies that define medical ideas and words. Medical data also lack proper sentence structure and do not adhere to the standard rules of natural language grammar. The main problem in this classification task is to choose an appropriate representation as input. To solve the representation problem, we propose a new extension model for medical text personification. Our model starts with the preprocessing of medical text. Then, we use external terminology resources to expand the text. After that, we use a combination of different text vector representations. To speed up the process, we try to increase the accuracy while selecting the optimal classification parameters. In this topic, we use an adaptive particle swarm optimization (PSO) algorithm to select the best parameters of a machine learning model. The PubMed, Hallmarks and AIM dataset were used to test our model. Our categorization text model outperforms the competition and provides much higher retrieval accuracy than previous models.