Abstract:To solve the problems of lengthy paragraphs, sparse data, scattered knowledge, and poor specification of text data in psychological medicine, a method based on the pre-trained model of multi-level feature extraction capability (MFE-BERT) and forward neural network attention (FNNAttention) mechanism is proposed for the construction of psychomedical knowledge graphs. Based on the BERT model, MFE-BERT merges and outputs all the internal encoder layer features to obtain feature vectors with more semantics. At the same time, the FNNAttention mechanism is applied to the two composite models to strengthen the word-level relationship and solve the semantic dilution of long text paragraphs. In the self-created psychomedical datasets, the compound neural network models of MFE-BERT-BiLSTM-FNNAttention-CRF and MFE-BERT-CNN-FNNAttention are designed for psychomedical entity recognition and entity relationship extraction respectively. The entity recognition F1 value reaches 93.91% and the entity relation extraction precision rate reaches 89.29%. The entity alignment is carried out by merging text similarity and semantic similarity. The collated data are stored in a Neo4j graph database, and a psychomedical knowledge graph containing 3652 entities and 2396 relationships is constructed. The experimental results show that it is practical and feasible to construct a psychomedical knowledge graph based on the MFE-BERT model and the FNNAttention mechanism, and the psychomedical knowledge graph built by the proposed improved models can be better applied in psychomedical information management, providing a reference for psychomedical data analysis.