{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/knowledge-enriched-transformer-for-emotion","title":"Knowledge-Enriched Transformer for Emotion Detection in Textual Conversations","arxiv_id":"1909.10681","date":"2019-09-24","proceeding":"IJCNLP 2019 11","authors":["Peixiang Zhong","Di Wang","Chunyan Miao"],"abstract":"Messages in human conversations inherently convey emotions. The task of detecting emotions in textual conversations leads to a wide range of applications such as opinion mining in social networks. However, enabling machines to analyze emotions in conversations is challenging, partly because humans often rely on the context and commonsense knowledge to express emotions. In this paper, we address these challenges by proposing a Knowledge-Enriched Transformer (KET), where contextual utterances are interpreted using hierarchical self-attention and external commonsense knowledge is dynamically leveraged using a context-aware affective graph attention mechanism. Experiments on multiple textual conversation datasets demonstrate that both context and commonsense knowledge are consistently beneficial to the emotion detection performance. In addition, the experimental results show that our KET model outperforms the state-of-the-art models on most of the tested datasets in F1 score.","url_abs":"https://arxiv.org/abs/1909.10681v2","url_pdf":"https://arxiv.org/pdf/1909.10681v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"knowledge-enriched-transformer-for-emotion","repo_url":"https://github.com/zhongpeixiang/KET","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"emotion-recognition-in-conversation","task_name":"Emotion Recognition in Conversation"},{"task_slug":"graph-attention","task_name":"Graph Attention"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/emotion-recognition-in-conversation-on-3","task":"Emotion Recognition in Conversation","dataset":"DailyDialog","model":"KET","rank_in_archive_order":19,"of":22,"metrics":{"Micro-F1":"53.37"},"uses_additional_data":false},{"leaderboard":"/sota/emotion-recognition-in-conversation-on-ec","task":"Emotion Recognition in Conversation","dataset":"EC","model":"KET","rank_in_archive_order":8,"of":9,"metrics":{"Micro-F1":"0.7413"},"uses_additional_data":false},{"leaderboard":"/sota/emotion-recognition-in-conversation-on-4","task":"Emotion Recognition in Conversation","dataset":"EmoryNLP","model":"KET","rank_in_archive_order":28,"of":28,"metrics":{"Weighted-F1":"34.39"},"uses_additional_data":true},{"leaderboard":"/sota/emotion-recognition-in-conversation-on","task":"Emotion Recognition in Conversation","dataset":"IEMOCAP","model":"KET","rank_in_archive_order":54,"of":59,"metrics":{"Micro-F1":"61.11","Weighted-F1":"61.33"},"uses_additional_data":false},{"leaderboard":"/sota/emotion-recognition-in-conversation-on-meld","task":"Emotion Recognition in Conversation","dataset":"MELD","model":"KET","rank_in_archive_order":62,"of":68,"metrics":{"Weighted-F1":"58.18"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1909.10681","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1909.10681"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zhongpeixiang/KET","reach":null}],"summary":{"ran_draft_wrong":3},"by_repo_kind":{"official":{"samples":3,"ran":3,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":3,"samples":[{"code_sha256_prefix":"0095c3fd72997cb8","entry":"create_examples_DD","repo":"zhongpeixiang/KET","repo_kind":"official","path":"preprocess.py","file_url":"https://github.com/zhongpeixiang/KET/blob/HEAD/preprocess.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"0095c3fd72997cb8"}},{"code_sha256_prefix":"2a88b38efd03b7ca","entry":"create_examples_EC","repo":"zhongpeixiang/KET","repo_kind":"official","path":"preprocess.py","file_url":"https://github.com/zhongpeixiang/KET/blob/HEAD/preprocess.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"2a88b38efd03b7ca"}},{"code_sha256_prefix":"f2b9357c953f0373","entry":"create_examples_MELD","repo":"zhongpeixiang/KET","repo_kind":"official","path":"preprocess.py","file_url":"https://github.com/zhongpeixiang/KET/blob/HEAD/preprocess.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"f2b9357c953f0373"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}