Metadata-Version: 2.1
Name: paraphrasel
Version: 0.0.2
Summary: Match word semantic similarity
Author-email: Reinier Koops <reinier.koops@outlook.com>
License: The MIT License (MIT)
        
        Copyright (c) 2025 ReinierKoops
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Documentation, https://reinierkoops.github.io/paraphrasel/
Project-URL: Repository, https://github.com/ReinierKoops/paraphrasel.git
Project-URL: Changelog, https://github.com/ReinierKoops/paraphrasel/releases
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: torch>=2.5.0
Requires-Dist: sentence_transformers>=3.0.0
Requires-Dist: click>=8.0.0
Provides-Extra: dev
Requires-Dist: black>=24.0.0; extra == "dev"
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: isort>=5.0.0; extra == "dev"
Requires-Dist: pre-commit>=4.0.0; extra == "dev"
Requires-Dist: ruff>=0.8.0; extra == "dev"
Requires-Dist: mkdocs>=1.6.0; extra == "dev"
Requires-Dist: mkdocs-material>=9.0.0; extra == "dev"

# Paraphrasel
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/paraphrasel)
![PyPI](https://img.shields.io/pypi/v/paraphrasel)
![PyPI - License](https://img.shields.io/pypi/l/paraphrasel)

## Introduction

Find similar word pairs based on semantics. Makes use of sentence transformers.

## Installation

Install via pip:

```cmd
pip install paraphrasel
```

## How to use with Python

Using this as a Python package you can use the following commands:

### Single:
```python
>>> from paraphrasel.match import compare

>>> compare("study", "해요 to do", language="all", decimals=2)
```
```
0.21
```

### Multiple:
```python
>>> from paraphrasel.match import compare_multiple

>>> compare("study", "해요 to do", language="all", decimals=2)
```
```
{
  "\ud574\uc694 to do": 0.21,
  "\uc9d1 house": 0.23,
  "\ub298\ub2e4 to play": 0.28
}
```

### Above Cutoff:
```python
>>> from paraphrasel.match import get_above_cutoff

>>> compare("study", "해요 to do", language="all", decimals=2, cutoff=0.22)
```
```
{
  "\uc9d1 house": 0.23,
  "\ub298\ub2e4 to play": 0.28
}
```

### Best Match:
```python
>>> from paraphrasel.match import get_best_match

>>> compare("study", "해요 to do", language="all", decimals=2, cutoff=0.22)
```
```
{
  "\ub298\ub2e4 to play": 0.28
}
```

## How to use with CMD/CLI

Using this as a CMD/CLI you can use the following commands:

### Single:
```bash
$ paraphrasel single study "해요 to do" --language all --decimals 2
```
```
0.21
```

### Multiple:
```bash
$ paraphrasel multiple study "해요 to do" "집 house" "늘다 to play" --language all --decimals 2
```
```
{
  "\ud574\uc694 to do": 0.21,
  "\uc9d1 house": 0.23,
  "\ub298\ub2e4 to play": 0.28
}
```

### Above Cutoff:
```bash
$ paraphrasel above-cutoff study "해요 to do" "집 house" "늘다 to play" --language all --decimals 2 --cutoff 0.22
```
```
{
  "\uc9d1 house": 0.23,
  "\ub298\ub2e4 to play": 0.28
}
```

### Best Match:
```bash
$ paraphrasel best-match study "해요 to do" "집 house" "늘다 to play" --language all --decimals 2 --cutoff 0.2
```
```
{
  "\ub298\ub2e4 to play": 0.28
}
```
