Name | emlangkit JSON |
Version |
0.2.0
JSON |
| download |
home_page | |
Summary | Emergent Language Analysis Toolkit |
upload_time | 2023-11-07 14:29:44 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.9 |
license | |
keywords |
emergent communication
emergent language
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://pre-commit.com/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
# Emergent Language Analysis Toolkit
This toolkit aims to collect all metrics currently used in emergent
communication research into one place. The usage should be convenient and the
inputs should be standardised, to ease adoption and spread of these metrics.
## Installation
To install emlangkit, run `pip install emlangkit`.
Automatic tests are run for Python 3.9, 3.10, 3.11.
## Usage
All metrics are available through the `Language` class in `emlangkit.Language`.
This class accepts two numpy arrays as inputs - messages and observations. These
are then used, with some possible speedups, to calculate any requested metric,
as per example below
```python
import numpy as np
from emlangkit import Language
messages = np.array(
[[1, 2, 0, 3, 4], [1, 2, 2, 3, 4], [1, 2, 2, 3, 0], [1, 0, 0, 1, 2]]
)
observations = np.array([[4, 4], [4, 3], [3, 2], [1, 4]])
lang = Language(messages=messages, observations=observations)
score, p_value = lang.topsim()
# Mutual information already requires both language and observation entropy
mi = lang.mutual_information()
# So this call uses less computation
lang_entropy = lang.language_entropy()
```
## Metrics
Currently available metrics, with their implementations as per below.
- Entropy \[1,2\] (`emlangkit.metrics.entropy`)
- Mutual Information \[1,2\] (`emlangkit.metrics.mutual_information`)
- Topographic Similarity \[1,2,3\] (`emlangkit.metrics.topsim`)
- Positional Disentanglement \[2,4\] (`emlangkit.metrics.posdis`)
- Bag-of-Words Disentanglement \[2,4\] (`emlangkit.metrics.bosdis`)
- M_previous^n \[5\] (`emlangkit.metrics.mpn`)
## Contributing
All pull requests are welcome! Just please make sure to install pre-commit and
run the pytests before submitting a PR. Additionally, if a lot of new code is
added, please also add the relevant tests.
## Related Libraries
This is a non-exhaustive list of libraries related to EC research. Please feel
free to open a PR to add to it!
- EGG - https://github.com/facebookresearch/EGG
- Harris' Articulation Scheme - https://github.com/wedddy0707/HarrisSegmentation
- CGI -
https://github.com/wedddy0707/categorial_grammar_induction_of_emergent_language
## Citation
If you find emlangkit useful in your work, please cite it as below:
```
@software{lipinski_emlangkit_2023,
title = {emlangkit: Emergent Language Analysis Toolkit},
url = {https://github.com/olipinski/emlangkit},
author = {Lipinski, Olaf},
year = {2023}
}
```
## Sources
Most of the base metrics are inspired or taken from either
[EGG](https://github.com/facebookresearch/EGG), or code from the paper
"Catalytic Role Of Noise And Necessity Of Inductive Biases In The Emergence Of
Compositional Communication"
[here](https://proceedings.neurips.cc/paper/2021/hash/c2839bed26321da8b466c80a032e4714-Abstract.html).
Citations for the metrics and parts of this software:
- \[1\] L. Kucinski, T. Korbak, P. Kolodziej, and P. Milos, ‘Catalytic Role Of
Noise And Necessity Of Inductive Biases In The Emergence Of Compositional
Communication’, NeurIPS 2021
- \[2\] E. Kharitonov, R. Chaabouni, D. Bouchacourt, and M. Baroni, ‘EGG: a
toolkit for research on Emergence of lanGuage in Games’, EMNLP-IJCNLP 2019
- \[3\] H. Brighton and S. Kirby, ‘Understanding Linguistic Evolution by
Visualizing the Emergence of Topographic Mappings’, Artificial Life, vol. 12,
no. 2, pp. 229–242, Apr. 2006
- \[4\] R. Chaabouni, E. Kharitonov, D. Bouchacourt, E. Dupoux, and M. Baroni,
‘Compositionality and Generalization In Emergent Languages’, ACL 2020
- \[5\] O. Lipinski, A. J. Sobey, F. Cerutti, and T. J. Norman, ‘On Temporal
References in Emergent Communication’. arXiv.2310.06555
- \[6\] R. Ueda, T. Ishii, and Y. Miyao, ‘On the Word Boundaries of Emergent
Languages Based on Harris’s Articulation Scheme’, ICLR 2023
Raw data
{
"_id": null,
"home_page": "",
"name": "emlangkit",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "emergent communication,emergent language",
"author": "",
"author_email": "Olaf Lipinski <o.lipinski@soton.ac.uk>",
"download_url": "https://files.pythonhosted.org/packages/f8/52/749be5045908c8924b7fa5cd9ace9c21d2b7fc528208dce506b5814a1880/emlangkit-0.2.0.tar.gz",
"platform": null,
"description": "[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://pre-commit.com/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n# Emergent Language Analysis Toolkit\n\nThis toolkit aims to collect all metrics currently used in emergent\ncommunication research into one place. The usage should be convenient and the\ninputs should be standardised, to ease adoption and spread of these metrics.\n\n## Installation\n\nTo install emlangkit, run `pip install emlangkit`.\n\nAutomatic tests are run for Python 3.9, 3.10, 3.11.\n\n## Usage\n\nAll metrics are available through the `Language` class in `emlangkit.Language`.\nThis class accepts two numpy arrays as inputs - messages and observations. These\nare then used, with some possible speedups, to calculate any requested metric,\nas per example below\n\n```python\nimport numpy as np\nfrom emlangkit import Language\n\nmessages = np.array(\n [[1, 2, 0, 3, 4], [1, 2, 2, 3, 4], [1, 2, 2, 3, 0], [1, 0, 0, 1, 2]]\n)\nobservations = np.array([[4, 4], [4, 3], [3, 2], [1, 4]])\n\nlang = Language(messages=messages, observations=observations)\n\nscore, p_value = lang.topsim()\n\n# Mutual information already requires both language and observation entropy\nmi = lang.mutual_information()\n\n# So this call uses less computation\nlang_entropy = lang.language_entropy()\n```\n\n## Metrics\n\nCurrently available metrics, with their implementations as per below.\n\n- Entropy \\[1,2\\] (`emlangkit.metrics.entropy`)\n- Mutual Information \\[1,2\\] (`emlangkit.metrics.mutual_information`)\n- Topographic Similarity \\[1,2,3\\] (`emlangkit.metrics.topsim`)\n- Positional Disentanglement \\[2,4\\] (`emlangkit.metrics.posdis`)\n- Bag-of-Words Disentanglement \\[2,4\\] (`emlangkit.metrics.bosdis`)\n- M_previous^n \\[5\\] (`emlangkit.metrics.mpn`)\n\n## Contributing\n\nAll pull requests are welcome! Just please make sure to install pre-commit and\nrun the pytests before submitting a PR. Additionally, if a lot of new code is\nadded, please also add the relevant tests.\n\n## Related Libraries\n\nThis is a non-exhaustive list of libraries related to EC research. Please feel\nfree to open a PR to add to it!\n\n- EGG - https://github.com/facebookresearch/EGG\n- Harris' Articulation Scheme - https://github.com/wedddy0707/HarrisSegmentation\n- CGI -\n https://github.com/wedddy0707/categorial_grammar_induction_of_emergent_language\n\n## Citation\n\nIf you find emlangkit useful in your work, please cite it as below:\n\n```\n@software{lipinski_emlangkit_2023,\n title = {emlangkit: Emergent Language Analysis Toolkit},\n url = {https://github.com/olipinski/emlangkit},\n author = {Lipinski, Olaf},\n year = {2023}\n}\n```\n\n## Sources\n\nMost of the base metrics are inspired or taken from either\n[EGG](https://github.com/facebookresearch/EGG), or code from the paper\n\"Catalytic Role Of Noise And Necessity Of Inductive Biases In The Emergence Of\nCompositional Communication\"\n[here](https://proceedings.neurips.cc/paper/2021/hash/c2839bed26321da8b466c80a032e4714-Abstract.html).\n\nCitations for the metrics and parts of this software:\n\n- \\[1\\] L. Kucinski, T. Korbak, P. Kolodziej, and P. Milos, \u2018Catalytic Role Of\n Noise And Necessity Of Inductive Biases In The Emergence Of Compositional\n Communication\u2019, NeurIPS 2021\n- \\[2\\] E. Kharitonov, R. Chaabouni, D. Bouchacourt, and M. Baroni, \u2018EGG: a\n toolkit for research on Emergence of lanGuage in Games\u2019, EMNLP-IJCNLP 2019\n- \\[3\\] H. Brighton and S. Kirby, \u2018Understanding Linguistic Evolution by\n Visualizing the Emergence of Topographic Mappings\u2019, Artificial Life, vol. 12,\n no. 2, pp. 229\u2013242, Apr. 2006\n- \\[4\\] R. Chaabouni, E. Kharitonov, D. Bouchacourt, E. Dupoux, and M. Baroni,\n \u2018Compositionality and Generalization In Emergent Languages\u2019, ACL 2020\n- \\[5\\] O. Lipinski, A. J. Sobey, F. Cerutti, and T. J. Norman, \u2018On Temporal\n References in Emergent Communication\u2019. arXiv.2310.06555\n- \\[6\\] R. Ueda, T. Ishii, and Y. Miyao, \u2018On the Word Boundaries of Emergent\n Languages Based on Harris\u2019s Articulation Scheme\u2019, ICLR 2023\n",
"bugtrack_url": null,
"license": "",
"summary": "Emergent Language Analysis Toolkit",
"version": "0.2.0",
"project_urls": {
"Bug Tracker": "https://github.com/olipinski/emlangkit/issues",
"Homepage": "https://github.com/olipinski/emlangkit"
},
"split_keywords": [
"emergent communication",
"emergent language"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "465fd5619745f795ea08dea9b6530bb765a626485af81e4d2ceba28f3cae8108",
"md5": "ba88d0a966ffb29bfa9aa41215fd2322",
"sha256": "eec49f6862b4a41a167304241c1cbe4319bdddd5dca27e1be83fe487618b05cd"
},
"downloads": -1,
"filename": "emlangkit-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ba88d0a966ffb29bfa9aa41215fd2322",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 16908,
"upload_time": "2023-11-07T14:29:39",
"upload_time_iso_8601": "2023-11-07T14:29:39.756987Z",
"url": "https://files.pythonhosted.org/packages/46/5f/d5619745f795ea08dea9b6530bb765a626485af81e4d2ceba28f3cae8108/emlangkit-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f852749be5045908c8924b7fa5cd9ace9c21d2b7fc528208dce506b5814a1880",
"md5": "5e03c8dbcbc258f4e8ca737511f63ef1",
"sha256": "8bb9f9aba491a58bb968f8376278449b034bb7b7bbf1cd3bca0afd2ce663310d"
},
"downloads": -1,
"filename": "emlangkit-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "5e03c8dbcbc258f4e8ca737511f63ef1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 16820,
"upload_time": "2023-11-07T14:29:44",
"upload_time_iso_8601": "2023-11-07T14:29:44.385216Z",
"url": "https://files.pythonhosted.org/packages/f8/52/749be5045908c8924b7fa5cd9ace9c21d2b7fc528208dce506b5814a1880/emlangkit-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-07 14:29:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "olipinski",
"github_project": "emlangkit",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "emlangkit"
}