{"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/choose-your-data-wisely-a-framework-for","title":"Choose your Data Wisely: A Framework for Semantic Counterfactuals","arxiv_id":"2305.17667","date":"2023-05-28","proceeding":null,"authors":["Edmund Dervakos","Konstantinos Thomas","Giorgos Filandrianos","Giorgos Stamou"],"abstract":"Counterfactual explanations have been argued to be one of the most intuitive forms of explanation. They are typically defined as a minimal set of edits on a given data sample that, when applied, changes the output of a model on that sample. However, a minimal set of edits is not always clear and understandable to an end-user, as it could, for instance, constitute an adversarial example (which is indistinguishable from the original data sample to an end-user). Instead, there are recent ideas that the notion of minimality in the context of counterfactuals should refer to the semantics of the data sample, and not to the feature space. In this work, we build on these ideas, and propose a framework that provides counterfactual explanations in terms of knowledge graphs. We provide an algorithm for computing such explanations (given some assumptions about the underlying knowledge), and quantitatively evaluate the framework with a user study.","url_abs":"https://arxiv.org/abs/2305.17667v1","url_pdf":"https://arxiv.org/pdf/2305.17667v1.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":"choose-your-data-wisely-a-framework-for","repo_url":"https://github.com/geofila/Semantic-Counterfactuals","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"counterfactual-explanation","task_name":"Counterfactual Explanation"},{"task_slug":"knowledge-graphs","task_name":"Knowledge Graphs"},{"task_slug":null,"task_name":"counterfactual"}],"methods":[{"method_slug":"counterfactuals","method_name":"Counterfactuals"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2305.17667","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.17667"}},"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/geofila/Semantic-Counterfactuals","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":10},"by_repo_kind":{"official":{"samples":10,"ran":0,"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":0,"samples":[{"code_sha256_prefix":"211758dc41460b9d","entry":"add_cost","repo":"geofila/Semantic-Counterfactuals","repo_kind":"official","path":"app/cece/graph.py","file_url":"https://github.com/geofila/Semantic-Counterfactuals/blob/HEAD/app/cece/graph.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"211758dc41460b9d"}},{"code_sha256_prefix":"5830fa4c39f354ac","entry":"connect_list_to_wordnet","repo":"geofila/Semantic-Counterfactuals","repo_kind":"official","path":"app/cece/wordnet.py","file_url":"https://github.com/geofila/Semantic-Counterfactuals/blob/HEAD/app/cece/wordnet.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5830fa4c39f354ac"}},{"code_sha256_prefix":"a4c9c3f8cebe8754","entry":"connect_term_to_wordnet","repo":"geofila/Semantic-Counterfactuals","repo_kind":"official","path":"app/cece/wordnet.py","file_url":"https://github.com/geofila/Semantic-Counterfactuals/blob/HEAD/app/cece/wordnet.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a4c9c3f8cebe8754"}},{"code_sha256_prefix":"ebd389719c881c7a","entry":"createMSQ","repo":"geofila/Semantic-Counterfactuals","repo_kind":"official","path":"app/cece/xDataset.py","file_url":"https://github.com/geofila/Semantic-Counterfactuals/blob/HEAD/app/cece/xDataset.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ebd389719c881c7a"}},{"code_sha256_prefix":"618ba52a2dd85c2c","entry":"default_addition_cost","repo":"geofila/Semantic-Counterfactuals","repo_kind":"official","path":"app/cece/refine.py","file_url":"https://github.com/geofila/Semantic-Counterfactuals/blob/HEAD/app/cece/refine.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"618ba52a2dd85c2c"}},{"code_sha256_prefix":"a3ebc56f7f874cef","entry":"default_obj_distance","repo":"geofila/Semantic-Counterfactuals","repo_kind":"official","path":"app/cece/refine.py","file_url":"https://github.com/geofila/Semantic-Counterfactuals/blob/HEAD/app/cece/refine.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a3ebc56f7f874cef"}},{"code_sha256_prefix":"8705fba37f270b79","entry":"default_removal_cost","repo":"geofila/Semantic-Counterfactuals","repo_kind":"official","path":"app/cece/refine.py","file_url":"https://github.com/geofila/Semantic-Counterfactuals/blob/HEAD/app/cece/refine.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8705fba37f270b79"}},{"code_sha256_prefix":"06d74383cb9e3feb","entry":"find_maximum_path","repo":"geofila/Semantic-Counterfactuals","repo_kind":"official","path":"app/cece/wordnet.py","file_url":"https://github.com/geofila/Semantic-Counterfactuals/blob/HEAD/app/cece/wordnet.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"06d74383cb9e3feb"}},{"code_sha256_prefix":"da9660a63f8e1518","entry":"node_transition_cost","repo":"geofila/Semantic-Counterfactuals","repo_kind":"official","path":"app/cece/graph.py","file_url":"https://github.com/geofila/Semantic-Counterfactuals/blob/HEAD/app/cece/graph.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"da9660a63f8e1518"}},{"code_sha256_prefix":"61142016e4a73d66","entry":"remove_cost","repo":"geofila/Semantic-Counterfactuals","repo_kind":"official","path":"app/cece/graph.py","file_url":"https://github.com/geofila/Semantic-Counterfactuals/blob/HEAD/app/cece/graph.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"61142016e4a73d66"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}