Natural Language Processing (NLP) is an important direction in the field of computer science and artificial intelligence. Combining with deep learning, NLP can effectively transform unstructured natural language into structured data. The electronic medical records of hospitals are mainly used in clinic, and the data of electronic medical records need to be reorganized to carry out research. This paper mainly studies the automatic classification and extraction of medical history information fields based on Convolutional neural network (CNN) and Long Short-Term Memory network (LSTM), aiming at solving the problem of traditional Chinese medicine. The classification problem of automatic extraction of all medical history information from mixed text information of medical records. The experimental results show that the F value is 0.8506 based on Convolutional Neural Network (CNN) and 0.8810 based on LSTM, which has good classification effect.