highered

raw JSON →
0.2.1 verified Fri May 01 auth: no python

Learnable Edit Distance using PyHacrf. Version 0.2.1. Infrequently updated.

pip install highered
error ImportError: No module named 'highered'
cause Package not installed or installed in wrong environment.
fix
Run 'pip install highered' and ensure the correct Python environment is active.
error TypeError: 'Higer' object is not callable
cause Attempting to call the class instead of instantiating and then using .fit or .predict.
fix
Create an instance: model = Higer() then model.fit(X, y).
error ValueError: operands could not be broadcast together with shapes
cause Inconsistent dimensions in training data or incompatible internal arrays from PyHacrf.
fix
Ensure all input strings are of consistent length or pad appropriately. Check PyHacrf documentation.
gotcha The package is in early development (0.2.1). API may change without notice.
fix Pin version in requirements and monitor for updates.
gotcha The library depends on PyHacrf which has its own dependencies (e.g., numpy, scipy). Ensure a compatible environment.
fix Install in a clean virtual environment or check PyHacrf documentation for system requirements.
gotcha The Higer class may expect specific input types (e.g., lists of tuples of strings). Non-string or unbalanced pairs may fail silently.
fix Always use pairs of strings; verify with small examples first.

Train a learnable edit distance model using Higer.

from highered import Higer, train

# Example training data: pairs of strings with label 1 for match, 0 for mismatch
X = [('abc', 'abc'), ('abc', 'abd')]
y = [1, 0]

model = Higer()
model.fit(X, y)

# Predict distance
print(model.predict(('abc', 'abc')))  # likely less than 0.5
print(model.predict(('abc', 'xyz')))  # likely greater than 0.5