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 aprob_b: list[np.array], containing the softmax output probabilties of model bgt: 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ca647c913c4083db9d688df37d1ee2ca46b413ff98edd006f42da41cfb649fa
|
|
| MD5 |
ecd269c90ccf1deef9aa6c9ee2603750
|
|
| BLAKE2b-256 |
2daf8f2333da1952a9410d29954ca3de1a1745a7e257fdd18d91626443fc0aa4
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64537cbe1050be95c3c262c722fc4770027da58374c849c9548a239a157cc009
|
|
| MD5 |
f5e2db272242f0a83fddd9b8d5200fa6
|
|
| BLAKE2b-256 |
2acd0c38d7fdd954c8245187075a9200834cdfff1c825aa88ee94ba98cb1a621
|