The fundamental ability of intelligent chatbots is to detecting emotions evident in intelligent recommendation systems, learning agent systems and mental health systems. Emotions are a key element in facilitating interaction and communication between humans. Researchers face challenges in studying the transmission of emotions through text. Despite significant advances in language transformation models, emotion recognition remains a major challenge due to the high semantic overlap between emotion categories and unbalanced distributions in datasets. This paper suggests an improved framework for enhanced transformer model based on a Label-Graph Interface (LGI) for ratings to robustly detect emotions across texts using various criteria specific to social media and conversations between humans and human-machine. It combines a pretrained transformer encoder with lightweight label relation inference layer that uses a row normalized graph prior and sample adaptive gate to propagate evidence among related emotion labels. In single label case, cross entropy loss is used to optimize the model, but in multi label detection a binary cross entropy is used with logits, class aware positive weighting and threshold selection based on validation sets. Six datasets were used in order to assess the framework: DAIR Emotion, achieved an macro-F1 to 89.10%. TweetEval Emotion is the second dataset reached an macro-F1 is 81.56%. DailyDialog, the macro-F1 arrived to 58.62%. GoEmotions, got micro-F1 about 60.03%. Empathetic Context dataset reached to 85.80% Top-3 accuracy and macro-F1 is 85.69% on the 32-class task. Lastly EmoWOZ is the most important dataset because it contains real conversation between human-machine has an accuracy about 92.86%, macro-F1 to 59.95% and AUC to 94.97%. The results demonstrate that the significant value and usefulness of relational inference at the classification level for emotion-based chatbot systems.