diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ca56e43..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" } @@ -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 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 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 b234d8a..687de05 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.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..5623d94 100644 --- a/timbl.py +++ b/timbl.py @@ -307,6 +307,18 @@ 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 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