From cb6b78e4d6797657cadff75f002279d1701c19fc Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Wed, 22 Jan 2025 14:51:44 +0100 Subject: [PATCH 1/6] version bump --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b234d8a..3d8881a 100755 --- a/setup.py +++ b/setup.py @@ -182,7 +182,7 @@ def build_extensions(self): setup( name="python3-timbl", - version="2024.12.18", + version="2025.01.22", description="Python 3 language binding for the Tilburg Memory-Based Learner", author="Sander Canisius, Maarten van Gompel", author_email="S.V.M.Canisius@uvt.nl, proycon@anaproy.nl", From 5707c71c60c50d06cbb9ee1fb1da289a4c9be0ba Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Wed, 22 Jan 2025 14:52:54 +0100 Subject: [PATCH 2/6] ci: mac wheel is now python 3.13 only, adapt --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ca56e43..3bfdcff 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -73,7 +73,7 @@ jobs: du -ah /opt/homebrew | grep boost_python - uses: actions/upload-artifact@v4 - if: ${{ ! (runner.os == 'macOS' && matrix.python.cp == 'cp313') }} + if: ${{ ! (runner.os == 'macOS' && matrix.python.cp != 'cp313') }} with: name: ${{matrix.python.cp}}-${{matrix.buildplat.sys}}-${{matrix.buildplat.arch}} path: ./wheelhouse/*.whl From 65f2b399c158a81ffa75b15d409c337660ba4576 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Fri, 2 May 2025 10:53:06 +0200 Subject: [PATCH 3/6] make bestNeighbours() method available in higher-level API --- example.py | 4 +++- setup.py | 2 +- timbl.py | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/example.py b/example.py index cb3edaf..2bc6a0c 100755 --- a/example.py +++ b/example.py @@ -53,7 +53,8 @@ os.unlink("testfile") -classifier = timbl.TimblClassifier("wsd-bank", "-a 0 -k 1" ) + +classifier = timbl.TimblClassifier("wsd-bank", "-a 0 -k 1 +v n+di+k" ) #add some extra verbosity flags classifier.load() classifier.addinstance("testfile", (1,0,0),'financial' ) #addinstance can be used to add instances to external files (use append() for training) classifier.addinstance("testfile", (0,1,0),'furniture' ) @@ -63,6 +64,7 @@ classifier.test("testfile") print("Accuracy: ", classifier.getAccuracy()) +print("Best neighbours: ", classifier.bestNeighbours()) #this only works with the extra verbosity flags and only if python-timbl is compiled with gcc diff --git a/setup.py b/setup.py index 3d8881a..687de05 100755 --- a/setup.py +++ b/setup.py @@ -182,7 +182,7 @@ def build_extensions(self): setup( name="python3-timbl", - version="2025.01.22", + version="2025.05.02", description="Python 3 language binding for the Tilburg Memory-Based Learner", author="Sander Canisius, Maarten van Gompel", author_email="S.V.M.Canisius@uvt.nl, proycon@anaproy.nl", diff --git a/timbl.py b/timbl.py index 604b377..786f8d2 100644 --- a/timbl.py +++ b/timbl.py @@ -307,6 +307,9 @@ def readtestoutput(self): yield " ".join(segments[:endfvec - 2]).split(self.delimiter), segments[endfvec - 2], segments[endfvec - 1], distribution, distance f.close() + def bestNeighbours(self): + return self.api.bestNeighbours() + def _parsedistribution(self, instance, start=0, end =None): dist = {} i = start + 1 From 7550c2c25cf64ac796de1ae44e46e9849da20e69 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Fri, 2 May 2025 10:55:07 +0200 Subject: [PATCH 4/6] README: removed badge --- README.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.rst b/README.rst index d1353b2..cd43574 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,3 @@ -.. image:: http://applejack.science.ru.nl/lamabadge.php/python-timbl - :target: http://applejack.science.ru.nl/languagemachines/ - .. image:: https://www.repostatus.org/badges/latest/active.svg :alt: Project Status: Active – The project has reached a stable, usable state and is being actively developed. :target: https://www.repostatus.org/#active From c0c96e626b46636219cc18e78cd39fd68772f4de Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Fri, 2 May 2025 10:57:33 +0200 Subject: [PATCH 5/6] ci: upgrade ubuntu --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 3bfdcff..9287a1d 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: buildplat: - - { runs_on: ubuntu-20.04, sys: manylinux, arch: x86_64, benv: "" } + - { runs_on: ubuntu-22.04, sys: manylinux, arch: x86_64, benv: "" } - { runs_on: macos-14, sys: macosx, arch: arm64, benv: "14.0" } python: - { cp: "cp310", rel: "3.10" } From 0ab2b55fc379304d3699b43d8429dad64613b4f4 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Fri, 2 May 2025 11:24:16 +0200 Subject: [PATCH 6/6] also propagate settings() and options() to higher-level API --- timbl.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/timbl.py b/timbl.py index 786f8d2..5623d94 100644 --- a/timbl.py +++ b/timbl.py @@ -310,6 +310,15 @@ def readtestoutput(self): def bestNeighbours(self): return self.api.bestNeighbours() + def bestNeighbors(self): + return self.api.bestNeighbours() + + def settings(self): + return self.api.settings() + + def options(self): + return self.api.options() + def _parsedistribution(self, instance, start=0, end =None): dist = {} i = start + 1