Relationship extraction among diseases, symptoms and tests has always been a concerning research issue in the biomedical field. Disease-pertinent relationship extraction for user-generated content in the online health community represents a research trend. By training the word embedding vectors for the medical-health field, conducting entity recognition and relationship annotation, and using deep learning technology, we construct a relation extraction model for extracting the relationships among diseases, symptoms and tests. Our relationship extraction model of the bidirectional gate recurrent unit (BiGRU) network based on character-level and sentence-level attention mechanisms achieved the best results on question-answer data in the online health community. Our research results can not only help physician diagnoses but also help patients perform health management, which has important industrial application value. INDEX TERMS Knowledge extraction, relationship extraction, attention mechanism, deep learning, bidirectional gated recurrent unit (BiGRU), online health community.