Skip to main content

Python package to compute similarity between LMs

Project description

LM-Similarity

lm-sim is a Python module for computing similarity between Language Models and is distributed under the MIT license.

Installation

Dependencies

lm-sim requries:

  • Python (>=3.9)
  • Numpy (>= 1.19.5)

User installation

If you already have a working installation of NumPy, the easiest way to install lm-sim is using pip:

pip install lm-sim

Example Usage

A simple example to compute probabilistic error consistency $k_p$ in the context of MCQs. Input has be to formatted as follows:

  • prob_a: list[np.array], containing the softmax output probabilties of model a
  • prob_b: list[np.array], containing the softmax output probabilties of model b
  • gt: list[int], containing the index of the ground truth
from lmsim.metrics import K_p

calculator = K_p()
calculator.compute_kp(prob_a, prob_b, gt)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lm_sim-0.0.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lm_sim-0.0.1-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file lm_sim-0.0.1.tar.gz.

File metadata

  • Download URL: lm_sim-0.0.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for lm_sim-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2ca647c913c4083db9d688df37d1ee2ca46b413ff98edd006f42da41cfb649fa
MD5 ecd269c90ccf1deef9aa6c9ee2603750
BLAKE2b-256 2daf8f2333da1952a9410d29954ca3de1a1745a7e257fdd18d91626443fc0aa4

See more details on using hashes here.

File details

Details for the file lm_sim-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: lm_sim-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for lm_sim-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 64537cbe1050be95c3c262c722fc4770027da58374c849c9548a239a157cc009
MD5 f5e2db272242f0a83fddd9b8d5200fa6
BLAKE2b-256 2acd0c38d7fdd954c8245187075a9200834cdfff1c825aa88ee94ba98cb1a621

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page