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.2.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.2-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lm_sim-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 941e8fe85256de0964f192e9b776ced74e91901d4ae6e0e77d207ea7cb83b099
MD5 8d95ff3e566d3b9062a87fb7d74dead7
BLAKE2b-256 25be77a5078f41158a883d20ab5d0923f0ae36bf3b64765a2e649349e6396d4b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lm_sim-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5a190c11cb4feebcafb851c11c649df908c5906fc36f023681cde12edc784643
MD5 5dcadedb389cec0d054ce48273a05b8c
BLAKE2b-256 d37ec49ae364f6aa8af7cdec4a4f6e1c0002d0b217902488bca931b58a5f8d9d

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