PHPackages                             itk-dev/sentence-similarity-metrics - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. itk-dev/sentence-similarity-metrics

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

itk-dev/sentence-similarity-metrics
===================================

Sentence similarity metrics

0.1.0(1y ago)0358MITPHPPHP &gt;=8.2

Since Feb 4Pushed 1y ago3 watchersCompare

[ Source](https://github.com/itk-dev/sentence-similarity-metrics)[ Packagist](https://packagist.org/packages/itk-dev/sentence-similarity-metrics)[ RSS](/packages/itk-dev-sentence-similarity-metrics/feed)WikiDiscussions develop Synced today

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

Sentence similarity metrics
===========================

[](#sentence-similarity-metrics)

A PHP library containing metrics for comparing sentences.

Install
-------

[](#install)

You can install this library by utilizing PHP Composer, which is the recommended dependency management tool for PHP.

```
composer require itk-dev/sentence-similarity-metrics
```

Metrics
-------

[](#metrics)

### Word error rate (WER)

[](#word-error-rate-wer)

WER is a metric used for determining the performance of a speech recognition system. See [Wikipedia: Word error rate](https://en.wikipedia.org/wiki/Word_error_rate) and [Metric: wer](https://huggingface.co/spaces/evaluate-metric/wer) for more information.

WER compares a reference sentence to a prediction made by a speech recognition system.

```
use ItkDev\SentenceSimilarityMetrics\WordErrorRate;

$wordErrorRate = new WordErrorRate();

$reference = 'I am 32 years old and I am a software developer';
$prediction = 'I am a 32 year old and I am as a developer';

$wer = $wordErrorRate->wer($reference, $prediction); // 0.36363636363636365
```

### Character error rate (CER)

[](#character-error-rate-cer)

CER is WER on character level rather than word level.

```
use ItkDev\SentenceSimilarityMetrics\CharacterErrorRate;

$characterErrorRate = new CharacterErrorRate();

$reference = 'I am 32 years old and I am a software developer';
$prediction = 'I am a 32 year old and I am as a developer';

$cer = $characterErrorRate->cer($reference, $prediction); // 0.2127659574468085
```

Development
-----------

[](#development)

### Install

[](#install-1)

To install the dependencies required for the development and usage of this library, run `composer install` through the supplied docker compose setup.

```
docker compose run --rm phpfpm composer install
```

### Tests

[](#tests)

We use the [PHPUnit](https://phpunit.de/) testing framework.

To run tests execute the following command:

```
docker compose run --rm phpfpm vendor/bin/phpunit --coverage-clover=coverage/unit.xml
```

### Check coding standards

[](#check-coding-standards)

The following commands let you test that the code follows the coding standards we decided to adhere to in this project.

```
docker compose run --rm phpfpm composer coding-standards-check
```

#### Check Markdown file

[](#check-markdown-file)

```
docker run --rm --volume "$PWD:/md" itkdev/markdownlint **/*.md --fix
docker run --rm --volume "$PWD:/md" itkdev/markdownlint **/*.md
```

### Apply coding standards

[](#apply-coding-standards)

You can automatically fix some coding styles issues by running:

```
docker compose run --rm phpfpm composer coding-standards-apply
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

515d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33924554?v=4)[ITK Development](/maintainers/itk-dev)[@itk-dev](https://github.com/itk-dev)

---

Top Contributors

[![jekuaitk](https://avatars.githubusercontent.com/u/78410897?v=4)](https://github.com/jekuaitk "jekuaitk (7 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/itk-dev-sentence-similarity-metrics/health.svg)

```
[![Health](https://phpackages.com/badges/itk-dev-sentence-similarity-metrics/health.svg)](https://phpackages.com/packages/itk-dev-sentence-similarity-metrics)
```

###  Alternatives

[torann/laravel-meta-tags

A package to manage Header Meta Tags

69279.6k4](/packages/torann-laravel-meta-tags)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
