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

@article{li2026matcha,
  title={MATCHA: Matching Text via Contrastive Semantic Alignment},
  author={Li, Siran and Etoglu, Ece Sena and Eickhoff, Carsten and Bahrainian, Seyed Ali},
  journal={arXiv preprint arXiv:2605.27345},
  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.7.tar.gz (5.5 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.7-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: matcha_metric-0.1.7.tar.gz
  • Upload date:
  • Size: 5.5 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.7.tar.gz
Algorithm Hash digest
SHA256 383106eaada228986634884e0228050e9ff8603923a4e7a8218d15ce07a95c37
MD5 d412ef66ef020e7245962906de66dce6
BLAKE2b-256 b502a6827dd7ed2fd41ea4b5868c29b153d829c2d2711c1209b5ff7491533a31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: matcha_metric-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 6.1 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 96c53310fa8af51467a2b272260313eb911cc2730f6354b3ba3c2248d3b5957a
MD5 69f98ad17aadac805486e7ce3170420b
BLAKE2b-256 63b0873e8d9dcd90df8eeb600c8828b6206a82167a866d9e8143f7023eaee806

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