{"id":19674077,"url":"https://github.com/frankaging/pragmatic-color-generation","last_synced_at":"2025-09-10T00:26:05.283Z","repository":{"id":37219525,"uuid":"279525661","full_name":"frankaging/Pragmatic-Color-Generation","owner":"frankaging","description":"Pragmatically Informative Color Generation by Grounding Contextual Modifiers","archived":false,"fork":false,"pushed_at":"2022-12-08T11:37:29.000Z","size":32852,"stargazers_count":3,"open_issues_count":27,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T05:35:06.100Z","etag":null,"topics":["grounding-contextual-modifiers","pragmatic-models"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2010.04372","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frankaging.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-14T08:20:48.000Z","updated_at":"2024-01-23T20:24:47.000Z","dependencies_parsed_at":"2023-01-25T13:00:07.890Z","dependency_job_id":null,"html_url":"https://github.com/frankaging/Pragmatic-Color-Generation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/frankaging/Pragmatic-Color-Generation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankaging%2FPragmatic-Color-Generation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankaging%2FPragmatic-Color-Generation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankaging%2FPragmatic-Color-Generation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankaging%2FPragmatic-Color-Generation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frankaging","download_url":"https://codeload.github.com/frankaging/Pragmatic-Color-Generation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankaging%2FPragmatic-Color-Generation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265871951,"owners_count":23842107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grounding-contextual-modifiers","pragmatic-models"],"created_at":"2024-11-11T17:17:09.080Z","updated_at":"2025-07-19T02:02:53.909Z","avatar_url":"https://github.com/frankaging.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pragmatically Informative Color Generation by Grounding Contextual Modifiers\n\nGrounding language in contextual information is crucial for fine-grained natural language understanding. One important task that involves grounding contextual modifiers is color generation. Given a reference color \"green\", and a modifier \"bluey\", how does one generate a color that could represent \"bluey green\"? We propose a computational pragmatics model that formulates this color generation task as a recursive game between speakers and listeners. In our model, a pragmatic speaker reasons about the inferences that a listener would make, and thus generates a modified color that is maximally informative to help the listener recover the original referents. Although such techniques have been successfully applied in cognitive science and computational linguistics reference-game tasks (e.g. learning of grounded contextual dependence in reference games), such pragmatic modeling has not been applied to tasks such as color generation, where one has to ground contextual modifiers to generate a sample from a large continuous space. In this paper, we show that incorporating pragmatic information into deep learning models provides significant improvements in performance compared with other state-of-the-art deep learning models. Our results also demonstrate an extensible pragmatic pipeline for other contextual image generation tasks.\n\n# Task Definition\n\u003cimg src=\"https://i.ibb.co/HgDg8KT/example.png\" width=\"300\"\u003e\n  - You are given triples include (Reference Color Lable, Modifier, Target Color Label)\n  - For color lables, you are given RGB vectors related to these colors. Each color will have a set of RGB vectors. It is not a **one to one** mapping.\n\n# Deep Learning Models\n\n\u003e The deep learning models are developed based on previous works,\n\u003e and serve as baselines in our paper.\n\n# Pragmatic Models\n\u003cimg src=\"https://i.ibb.co/8bfgZ7F/pragmatic-model.png\" width=\"500\"\u003e\n\n# Performance Results\n\u003cimg src=\"https://i.ibb.co/y54h9MC/perf.png\" width=\"500\"\u003e\n\n# Examples of the Color Generation Task\n\u003cimg src=\"https://i.ibb.co/25bFGJk/result-detail.png\" width=\"500\"\u003e\n\n### Installation\n\nOur code requires python v3.6+ to run. You will also need various libraries such as pytorch, sklearn, etc..\n\nInstall the dependencies and devDependencies and start the server.\n\n```sh\n$ cd Pragmatic-Color-Generation\n$ pip install requirements.txt\n```\n\n### How to run code?\nWith our pretrained models and preprocess datasets, you can go to our code directly, and:\n```python\n$ cd model\n$ jupyter notebook\n```\nYou can use the files to retrain models as well. Details about flags and settings are in the file.\n\nTo re-preprocess the dataset, you can use\n```python\n$ cd model\n$ python dataset.py\n```\n\nLicense\n----\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrankaging%2Fpragmatic-color-generation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrankaging%2Fpragmatic-color-generation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrankaging%2Fpragmatic-color-generation/lists"}