MATCHA — Matching Text via Contrastive Semantic Alignment
A learned text similarity metric that captures both semantic alignment and contradiction through contrastive training.
Paper: MATCHA | Model: HuggingFace | Code: GitHub
Installation
pip install matcha-metric
Usage
from matcha_metric import MATCHA
model = MATCHA.from_pretrained("Siran-Li/MATCHA")
# Score a pair of texts
similarity = model.score("A dog is playing in the park.", "A puppy is running outside.")
print(f"Similarity: {similarity:.4f}")
# Batch scoring
scores = model.score(
["The cat sat on the mat.", "It is raining outside."],
["A feline rested on the rug.", "The weather is sunny and clear."],
)
# Get embeddings directly
embeddings = model.encode(["Hello world", "Hi there"])
Citation
@inproceedings{li2026matcha,
title={MATCHA: Matching Text via Contrastive Semantic Alignment},
author={Li, Siran and Etoglu, Ece Sena and Eickhoff, Carsten and Bahrainian, Seyed Ali},
booktitle={Findings of the Association for Computational Linguistics: ACL 2026},
pages={21001--21018},
year={2026}
}
Release files for matcha-metric 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| matcha_metric-0.1.8.tar.gz | 5.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| matcha_metric-0.1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.8 kB
Release files / matcha_metric-0.1.8.tar.gz
| Download URL | matcha_metric-0.1.8.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0b8a8cf83a28fc19470e8fad78032a263976cf5c266b8bcedbaad5b06314f663
|
|
BLAKE2b-256 checksum How to use checksums |
2e0ed157124087ece9d50cbf7d612d430efea53a20f515d2034fb0addd7b8d6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / matcha_metric-0.1.8-py3-none-any.whl
| Download URL | matcha_metric-0.1.8-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52b31237dac6f1712372ce821f66dacbc78d250707968e94893887b41eccf0da
|
|
BLAKE2b-256 checksum How to use checksums |
2040c507e233d953c264bd2419e82a92760d42343987198343ae0404b70dbc4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|