emlangkit

Emergent Langauge Analysis Toolkit

https://github.com/olipinski/emlangkit

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.7%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Emergent Langauge Analysis Toolkit

Basic Info
  • Host: GitHub
  • Owner: olipinski
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 40 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 4
Created over 2 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

pre-commit Code style: 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, 3.12.

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

langentropy = lang.languageentropy() ```

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)
  • Harris' Articulation Scheme [6] (emlangkit.metrics.has)
  • Non-Compositional Normalised Pointwise Mutual Information (NPMI) [7] (emlangkit.metrics.nc_npmi)

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/categorialgrammarinductionofemergent_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, or code from the paper "Catalytic Role Of Noise And Necessity Of Inductive Biases In The Emergence Of Compositional Communication" here.

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
  • [7] O. Lipinski, A. J. Sobey, F. Cerutti, and T. J. Norman, ‘Speaking Your Language: Spatial Relationships in Interpretable Emergent Communication’, NeurIPS 2024

Owner

  • Name: Olaf Lipinski
  • Login: olipinski
  • Kind: user
  • Location: Southampton
  • Company: University of Southampton

PhD Student @ MINDS CDT @southampton

Citation (CITATION.cff)

cff-version: 1.2.0
title: emlangkit
message: "If you use this software, please cite it as below."
type: software
authors:
  - given-names: Olaf
    family-names: Lipinski
    email: o.lipinski@soton.ac.uk
    affiliation: University of Southampton
    orcid: 'https://orcid.org/0000-0002-2023-7617'
url: 'https://github.com/olipinski/emlangkit'
keywords:
  - artificial intelligence
  - reinforcement learning
  - emergent communication
license: MIT
version: 0.0.1

GitHub Events

Total
  • Release event: 1
  • Watch event: 1
  • Delete event: 1
  • Push event: 4
  • Pull request event: 4
  • Create event: 3
Last Year
  • Release event: 1
  • Watch event: 1
  • Delete event: 1
  • Push event: 4
  • Pull request event: 4
  • Create event: 3

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 0
  • Total pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: about 2 hours
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: about 2 hours
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • olipinski (2)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 11 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 4
  • Total maintainers: 1
pypi.org: emlangkit

Emergent Language Analysis Toolkit

  • Homepage: https://github.com/olipinski/emlangkit
  • Documentation: https://emlangkit.readthedocs.io/
  • License: MIT License Copyright (c) 2021 Łukasz Kuciński, Tomasz Korbak, Paweł Kołodziej, Piotr Miłoś Copyright (c) Facebook, Inc. and its affiliates. Copyright (c) 2023 Ryo Ueda Copyright (c) 2023 Olaf Lipinski Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 0.3.0
    published over 1 year ago
  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 11 Last month
Rankings
Dependent packages count: 9.6%
Average: 38.8%
Dependent repos count: 68.0%
Maintainers (1)
Last synced: 10 months ago