Skip to main content

MATCHA: Matching Text via Contrastive Semantic Alignment

Project description

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}
}

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

matcha_metric-0.1.8.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

matcha_metric-0.1.8-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file matcha_metric-0.1.8.tar.gz.

File metadata

  • Download URL: matcha_metric-0.1.8.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for matcha_metric-0.1.8.tar.gz
Algorithm Hash digest
SHA256 0b8a8cf83a28fc19470e8fad78032a263976cf5c266b8bcedbaad5b06314f663
MD5 ce1d7bd4c5f7fd90859b2a29b982a6b9
BLAKE2b-256 2e0ed157124087ece9d50cbf7d612d430efea53a20f515d2034fb0addd7b8d6e

See more details on using hashes here.

File details

Details for the file matcha_metric-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: matcha_metric-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for matcha_metric-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 52b31237dac6f1712372ce821f66dacbc78d250707968e94893887b41eccf0da
MD5 e0239a108574d4e05e21ee4f73b0251d
BLAKE2b-256 2040c507e233d953c264bd2419e82a92760d42343987198343ae0404b70dbc4a

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