Matheel 0.3.0__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- matheel-0.3.2/LICENSE +21 -0
- {matheel-0.3.0 → matheel-0.3.2}/PKG-INFO +10 -6
- {matheel-0.3.0 → matheel-0.3.2}/README.md +8 -4
- {matheel-0.3.0 → matheel-0.3.2}/matheel/cli.py +9 -0
- {matheel-0.3.0 → matheel-0.3.2}/matheel/comparison_suite.py +6 -2
- {matheel-0.3.0 → matheel-0.3.2}/matheel/feature_weights.py +8 -1
- {matheel-0.3.0 → matheel-0.3.2}/matheel/similarity.py +325 -67
- {matheel-0.3.0 → matheel-0.3.2}/matheel.egg-info/PKG-INFO +10 -6
- {matheel-0.3.0 → matheel-0.3.2}/matheel.egg-info/SOURCES.txt +1 -0
- {matheel-0.3.0 → matheel-0.3.2}/pyproject.toml +2 -2
- {matheel-0.3.0 → matheel-0.3.2}/tests/test_cli.py +9 -0
- {matheel-0.3.0 → matheel-0.3.2}/tests/test_comparison_suite.py +8 -0
- {matheel-0.3.0 → matheel-0.3.2}/tests/test_feature_weights.py +17 -1
- matheel-0.3.2/tests/test_gradio_app.py +122 -0
- {matheel-0.3.0 → matheel-0.3.2}/tests/test_similarity.py +89 -0
- matheel-0.3.0/LICENSE +0 -407
- {matheel-0.3.0 → matheel-0.3.2}/matheel/__init__.py +0 -0
- {matheel-0.3.0 → matheel-0.3.2}/matheel/chunking.py +0 -0
- {matheel-0.3.0 → matheel-0.3.2}/matheel/code_metrics.py +0 -0
- {matheel-0.3.0 → matheel-0.3.2}/matheel/model_routing.py +0 -0
- {matheel-0.3.0 → matheel-0.3.2}/matheel/preprocessing.py +0 -0
- {matheel-0.3.0 → matheel-0.3.2}/matheel/vectors.py +0 -0
- {matheel-0.3.0 → matheel-0.3.2}/matheel.egg-info/dependency_links.txt +0 -0
- {matheel-0.3.0 → matheel-0.3.2}/matheel.egg-info/entry_points.txt +0 -0
- {matheel-0.3.0 → matheel-0.3.2}/matheel.egg-info/requires.txt +0 -0
- {matheel-0.3.0 → matheel-0.3.2}/matheel.egg-info/top_level.txt +0 -0
- {matheel-0.3.0 → matheel-0.3.2}/setup.cfg +0 -0
- {matheel-0.3.0 → matheel-0.3.2}/tests/test_chunking.py +0 -0
- {matheel-0.3.0 → matheel-0.3.2}/tests/test_code_metrics.py +0 -0
- {matheel-0.3.0 → matheel-0.3.2}/tests/test_model_routing.py +0 -0
- {matheel-0.3.0 → matheel-0.3.2}/tests/test_preprocessing.py +0 -0
- {matheel-0.3.0 → matheel-0.3.2}/tests/test_real_models.py +0 -0
- {matheel-0.3.0 → matheel-0.3.2}/tests/test_vectors.py +0 -0
matheel-0.3.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Fahad Ebrahim
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: matheel
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Matheel: A CLI and Python package for source-code similarity detection.
|
|
5
5
|
Author: Fahad Ebrahim
|
|
6
|
-
License-Expression:
|
|
6
|
+
License-Expression: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/FahadEbrahim/matheel
|
|
8
8
|
Project-URL: Source, https://github.com/FahadEbrahim/matheel
|
|
9
9
|
Requires-Python: <3.13,>=3.10
|
|
@@ -121,6 +121,8 @@ Similarity features:
|
|
|
121
121
|
- `semantic`
|
|
122
122
|
- `levenshtein`
|
|
123
123
|
- `jaro_winkler`
|
|
124
|
+
- `winnowing`
|
|
125
|
+
- `gst`
|
|
124
126
|
- `code_metric`
|
|
125
127
|
|
|
126
128
|
Code metrics:
|
|
@@ -172,7 +174,7 @@ Sentence Transformers pooling methods:
|
|
|
172
174
|
- Preprocessing: whitespace and comment normalization before any scoring.
|
|
173
175
|
- Chunking: Chonkie-backed document splitting with per-method options.
|
|
174
176
|
- Vectors: dense single-vector, learned static single-vector, and multivector late interaction.
|
|
175
|
-
-
|
|
177
|
+
- Lexical metrics and baselines: normalized Levenshtein, Jaro-Winkler, Winnowing, and Greedy String Tiling.
|
|
176
178
|
- Code metrics: built-in CodeBLEU-style metrics and CrystalBLEU.
|
|
177
179
|
- Comparison suite: run multiple configurations, rank them, and optionally write summary/detail artifacts.
|
|
178
180
|
|
|
@@ -253,7 +255,9 @@ results = get_sim_list(
|
|
|
253
255
|
feature_weights={
|
|
254
256
|
"semantic": 0.7,
|
|
255
257
|
"levenshtein": 0.15,
|
|
256
|
-
"jaro_winkler": 0.
|
|
258
|
+
"jaro_winkler": 0.05,
|
|
259
|
+
"winnowing": 0.05,
|
|
260
|
+
"gst": 0.05,
|
|
257
261
|
},
|
|
258
262
|
)
|
|
259
263
|
```
|
|
@@ -293,8 +297,8 @@ The `docs/` folder is already structured well for a later GitHub Pages setup if
|
|
|
293
297
|
|
|
294
298
|
## Gradio
|
|
295
299
|
|
|
296
|
-
The Gradio demo stays in `gradio_app
|
|
300
|
+
The Gradio demo stays in `gradio_app/` and is aligned with the Hugging Face Space setup. The UI supports embeddings, lexical metrics, baseline algorithms (Winnowing and GST), and the code-aware metrics (CodeBLEU, CrystalBLEU, RUBY, TSED, CodeBERTScore), with metric-specific advanced fields. The core package and CLI can read either a ZIP archive or a directory; the Gradio upload flow remains ZIP-based.
|
|
297
301
|
|
|
298
302
|
## License
|
|
299
303
|
|
|
300
|
-
This project is licensed under the [
|
|
304
|
+
This project is licensed under the [MIT License](LICENSE).
|
|
@@ -73,6 +73,8 @@ Similarity features:
|
|
|
73
73
|
- `semantic`
|
|
74
74
|
- `levenshtein`
|
|
75
75
|
- `jaro_winkler`
|
|
76
|
+
- `winnowing`
|
|
77
|
+
- `gst`
|
|
76
78
|
- `code_metric`
|
|
77
79
|
|
|
78
80
|
Code metrics:
|
|
@@ -124,7 +126,7 @@ Sentence Transformers pooling methods:
|
|
|
124
126
|
- Preprocessing: whitespace and comment normalization before any scoring.
|
|
125
127
|
- Chunking: Chonkie-backed document splitting with per-method options.
|
|
126
128
|
- Vectors: dense single-vector, learned static single-vector, and multivector late interaction.
|
|
127
|
-
-
|
|
129
|
+
- Lexical metrics and baselines: normalized Levenshtein, Jaro-Winkler, Winnowing, and Greedy String Tiling.
|
|
128
130
|
- Code metrics: built-in CodeBLEU-style metrics and CrystalBLEU.
|
|
129
131
|
- Comparison suite: run multiple configurations, rank them, and optionally write summary/detail artifacts.
|
|
130
132
|
|
|
@@ -205,7 +207,9 @@ results = get_sim_list(
|
|
|
205
207
|
feature_weights={
|
|
206
208
|
"semantic": 0.7,
|
|
207
209
|
"levenshtein": 0.15,
|
|
208
|
-
"jaro_winkler": 0.
|
|
210
|
+
"jaro_winkler": 0.05,
|
|
211
|
+
"winnowing": 0.05,
|
|
212
|
+
"gst": 0.05,
|
|
209
213
|
},
|
|
210
214
|
)
|
|
211
215
|
```
|
|
@@ -245,8 +249,8 @@ The `docs/` folder is already structured well for a later GitHub Pages setup if
|
|
|
245
249
|
|
|
246
250
|
## Gradio
|
|
247
251
|
|
|
248
|
-
The Gradio demo stays in `gradio_app
|
|
252
|
+
The Gradio demo stays in `gradio_app/` and is aligned with the Hugging Face Space setup. The UI supports embeddings, lexical metrics, baseline algorithms (Winnowing and GST), and the code-aware metrics (CodeBLEU, CrystalBLEU, RUBY, TSED, CodeBERTScore), with metric-specific advanced fields. The core package and CLI can read either a ZIP archive or a directory; the Gradio upload flow remains ZIP-based.
|
|
249
253
|
|
|
250
254
|
## License
|
|
251
255
|
|
|
252
|
-
This project is licensed under the [
|
|
256
|
+
This project is licensed under the [MIT License](LICENSE).
|
|
@@ -132,6 +132,9 @@ def main():
|
|
|
132
132
|
@click.option('--codebertscore-verbose/--no-codebertscore-verbose', default=False, show_default=True, help='Verbose CodeBERTScore output.')
|
|
133
133
|
@click.option('--levenshtein-weights', default='1,1,1', show_default=True, help='Comma-separated insert,delete,substitute costs for Levenshtein.')
|
|
134
134
|
@click.option('--jaro-winkler-prefix-weight', default=0.1, show_default=True, help='Prefix bonus weight for Jaro-Winkler (0.0 to 0.25).')
|
|
135
|
+
@click.option('--winnowing-kgram', default=5, show_default=True, help='Token k-gram size used by Winnowing.')
|
|
136
|
+
@click.option('--winnowing-window', default=4, show_default=True, help='Window size used by Winnowing fingerprint selection.')
|
|
137
|
+
@click.option('--gst-min-match-length', default=5, show_default=True, help='Minimum token tile length used by Greedy String Tiling.')
|
|
135
138
|
@click.option(
|
|
136
139
|
'--vector-backend',
|
|
137
140
|
type=click.Choice(available_vector_backends()),
|
|
@@ -212,6 +215,9 @@ def compare(
|
|
|
212
215
|
codebertscore_verbose,
|
|
213
216
|
levenshtein_weights,
|
|
214
217
|
jaro_winkler_prefix_weight,
|
|
218
|
+
winnowing_kgram,
|
|
219
|
+
winnowing_window,
|
|
220
|
+
gst_min_match_length,
|
|
215
221
|
vector_backend,
|
|
216
222
|
similarity_function,
|
|
217
223
|
static_vector_dim,
|
|
@@ -272,6 +278,9 @@ def compare(
|
|
|
272
278
|
codebertscore_verbose=codebertscore_verbose,
|
|
273
279
|
levenshtein_weights=levenshtein_weights,
|
|
274
280
|
jaro_winkler_prefix_weight=jaro_winkler_prefix_weight,
|
|
281
|
+
winnowing_kgram=winnowing_kgram,
|
|
282
|
+
winnowing_window=winnowing_window,
|
|
283
|
+
gst_min_match_length=gst_min_match_length,
|
|
275
284
|
vector_backend=vector_backend,
|
|
276
285
|
similarity_function=similarity_function,
|
|
277
286
|
static_vector_dim=static_vector_dim,
|
|
@@ -63,8 +63,12 @@ def normalize_run_config(config, index=1):
|
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
def _normalize_run_feature_weights(options):
|
|
66
|
-
for
|
|
67
|
-
|
|
66
|
+
legacy_weight_keys = [key for key in ("ws", "wl", "wj", "Ws", "Wl", "Wj") if key in options]
|
|
67
|
+
if legacy_weight_keys:
|
|
68
|
+
keys = ", ".join(sorted(legacy_weight_keys))
|
|
69
|
+
raise ValueError(
|
|
70
|
+
f"Legacy weight keys are no longer supported ({keys}). Use feature_weights instead."
|
|
71
|
+
)
|
|
68
72
|
|
|
69
73
|
resolved = parse_feature_weights(options.get("feature_weights"))
|
|
70
74
|
|
|
@@ -6,7 +6,14 @@ _DEFAULT_FEATURE_WEIGHTS = {
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
def available_default_features():
|
|
9
|
-
return (
|
|
9
|
+
return (
|
|
10
|
+
"semantic",
|
|
11
|
+
"levenshtein",
|
|
12
|
+
"jaro_winkler",
|
|
13
|
+
"winnowing",
|
|
14
|
+
"gst",
|
|
15
|
+
"code_metric",
|
|
16
|
+
)
|
|
10
17
|
|
|
11
18
|
|
|
12
19
|
def _validate_weight_name(name):
|