This research proposes an explainable transformer-based framework for automated depression detection from social media text by integrating contextual embeddings from BERT and RoBERTa with a Bidirectional Long Short-Term Memory (BiLSTM) network and an attention mechanism. The proposed model achieved an accuracy of **83.30%** and a **ROC-AUC of 0.9196**, outperforming several baseline methods on the Mental Health Twitter Dataset. To improve transparency, the framework incorporates SHAP analysis and attention heatmap visualization to identify influential textual features, while a semantic knowledge graph captures relationships among depression-related psychological concepts. By combining transformer-based learning, attention-enhanced sequence modeling, explainable artificial intelligence (XAI), and semantic knowledge representation, the proposed framework provides an accurate, interpretable, and reliable solution for depression detection from social media data.
