diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b7faf403d915ca307532bb0eb9cceaf0214e8e5b --- /dev/null +++ b/.gitignore @@ -0,0 +1,207 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[codz] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py.cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# UV +# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +#uv.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock +#poetry.toml + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python. +# https://pdm-project.org/en/latest/usage/project/#working-with-version-control +#pdm.lock +#pdm.toml +.pdm-python +.pdm-build/ + +# pixi +# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control. +#pixi.lock +# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one +# in the .venv directory. It is recommended not to include this directory in version control. +.pixi + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.envrc +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +# Abstra +# Abstra is an AI-powered process automation framework. +# Ignore directories containing user credentials, local state, and settings. +# Learn more at https://abstra.io/docs +.abstra/ + +# Visual Studio Code +# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore +# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore +# and can be added to the global gitignore or merged into this file. However, if you prefer, +# you could uncomment the following to ignore the entire vscode folder +# .vscode/ + +# Ruff stuff: +.ruff_cache/ + +# PyPI configuration file +.pypirc + +# Cursor +# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to +# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data +# refer to https://docs.cursor.com/context/ignore-files +.cursorignore +.cursorindexingignore + +# Marimo +marimo/_static/ +marimo/_lsp/ +__marimo__/ diff --git a/config.json b/config.json new file mode 100644 index 0000000000000000000000000000000000000000..f9ca256a6905da50e0cac24e1bfb3b61f078e155 --- /dev/null +++ b/config.json @@ -0,0 +1,8 @@ +{ + "architectures": ["SmSubgroupClassifier"], + "auto_map": { + "AutoConfig": "configuration_sm_subgroup_classifier.SmSubgroupClassifierConfig", + "AutoModel": "modeling_sm_subgroup_classifier.SmSubgroupClassifier" + }, + "model_type": "sm_subgroup_classifier" +} \ No newline at end of file diff --git a/configuration_sm_subgroup_classifier.py b/configuration_sm_subgroup_classifier.py new file mode 100644 index 0000000000000000000000000000000000000000..8668927c6f5840c8d368804af1d4932c7271c6d6 --- /dev/null +++ b/configuration_sm_subgroup_classifier.py @@ -0,0 +1,9 @@ +from transformers import PretrainedConfig + + +class SmSubgroupClassifierConfig(PretrainedConfig): + model_type = "sm_subgroup_classifier" + + def __init__(self, available_models=None, **kwargs): + super().__init__(**kwargs) + self.available_models = available_models or [] diff --git a/en_ID/metadata.pkl b/en_ID/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..69d78abeb3c5ddcf27b0fae356acf817233e65ed --- /dev/null +++ b/en_ID/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ca61fbfd1ba2ce417a30bde0d53adf2ffd1ea1a8c6186eff0149c770f001c10 +size 62 diff --git a/en_ID/model.pkl b/en_ID/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..f8a44bb3fef6b33f8cfbcbb72b93f930d70d162c --- /dev/null +++ b/en_ID/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48dc684753e19792ce04cadeae9025441fc6507396eb93ab6dc740f87f1f3dad +size 9055 diff --git a/en_ID/scaler.pkl b/en_ID/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..333d01f2d9b3562460169527f263b8f3a4ec1d18 --- /dev/null +++ b/en_ID/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f230b5ecc0b0cf4a07aec1ab185ebea9060ea6eca6f7780119e9416ec15c0f1 +size 25191 diff --git a/en_ID/training_details.txt b/en_ID/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..af5d80ed19255d316d1b601bba918b0e09184da6 --- /dev/null +++ b/en_ID/training_details.txt @@ -0,0 +1,39 @@ +Training Details for en_ID +======================================== + +Language: en +Register: ID +Training Date: 2025-09-26 14:09:04 + +Data Summary: +- Total samples: 41071 +- Training samples: 32856 +- Test samples: 8215 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 2 +- Class names: 'sports', '' +- Class distribution: {'sports': 983, '': 40088} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.9984783931832014, 0.9987825292953888, 0.9975650585907777, 0.9989347131334653, 0.9981737939430833] +- CV mean: 0.9984 +- CV std: 0.0005 +- CV confidence interval: 0.9984 ± 0.0010 + +Final Performance: +- Test accuracy: 0.9988 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt diff --git a/en_NA-nb-OP/metadata.pkl b/en_NA-nb-OP/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..8409bf186029ea2418cfdc2a5a5810dfef77a31f --- /dev/null +++ b/en_NA-nb-OP/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33039d60b51479962f055e496f8b49f16e8c9dd1d424896502d1fe6db7cb9005 +size 84 diff --git a/en_NA-nb-OP/model.pkl b/en_NA-nb-OP/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..b535743033c21f8cf3ec2f5b1c00003e9d9dfeb2 --- /dev/null +++ b/en_NA-nb-OP/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f83d56eccb7a610a0b57baa16d63af8839c571455358919a4d892bcf581a66e +size 33671 diff --git a/en_NA-nb-OP/scaler.pkl b/en_NA-nb-OP/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..37c3483e80aa5f97b76dc9daefc5dbb1cced639d --- /dev/null +++ b/en_NA-nb-OP/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85019b0b45399ef17ada3a02dbb3c77b0783fca6e0e18bd4e8e818e740f304c7 +size 25191 diff --git a/en_NA-nb-OP/training_details.txt b/en_NA-nb-OP/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..80ef7e4db2eeabf8afe04f117783e58f0ea3d4a4 --- /dev/null +++ b/en_NA-nb-OP/training_details.txt @@ -0,0 +1,39 @@ +Training Details for en_NA-nb-OP +======================================== + +Language: en +Register: NA-nb-OP +Training Date: 2025-09-26 14:08:46 + +Data Summary: +- Total samples: 1536 +- Training samples: 1228 +- Test samples: 308 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 4 +- Class names: '', 'culture', 'dining', 'lifestyle' +- Class distribution: {'': 747, 'culture': 327, 'dining': 172, 'lifestyle': 290} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.9634146341463414, 0.959349593495935, 0.9634146341463414, 0.9877551020408163, 0.9755102040816327] +- CV mean: 0.9699 +- CV std: 0.0104 +- CV confidence interval: 0.9699 ± 0.0209 + +Final Performance: +- Test accuracy: 0.9643 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt diff --git a/en_NA-nb/metadata.pkl b/en_NA-nb/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..25b417ea912e330617b411ee0052d683933893ef --- /dev/null +++ b/en_NA-nb/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:836ae4c831fe01dd10837795f65517e2768a1b1bd5364187226b09a39044826b +size 64 diff --git a/en_NA-nb/model.pkl b/en_NA-nb/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..72a5938cacb5403997fddc42b51068f6b1ff94f6 --- /dev/null +++ b/en_NA-nb/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97142d5962fb70803f26b449fa21ced30015b550de8604dc850ad50c07bee259 +size 9055 diff --git a/en_NA-nb/scaler.pkl b/en_NA-nb/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..78dd160900ef9946c83f2cc1a36fbab0fffe0970 --- /dev/null +++ b/en_NA-nb/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7423f9e8f84672e12ec4a45f5886d488146a6b5f20fc6a48db4977e89f663078 +size 25191 diff --git a/en_NA-nb/training_details.txt b/en_NA-nb/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..a34b64d8998a79f377b87cd2b087032e64d0f0f6 --- /dev/null +++ b/en_NA-nb/training_details.txt @@ -0,0 +1,39 @@ +Training Details for en_NA-nb +======================================== + +Language: en +Register: NA-nb +Training Date: 2025-09-26 14:08:58 + +Data Summary: +- Total samples: 49026 +- Training samples: 39220 +- Test samples: 9806 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 2 +- Class names: '', 'comments' +- Class distribution: {'': 46239, 'comments': 2787} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.989673635900051, 0.9886537480877103, 0.9903110657827638, 0.9899286078531362, 0.9903110657827638] +- CV mean: 0.9898 +- CV std: 0.0006 +- CV confidence interval: 0.9898 ± 0.0012 + +Final Performance: +- Test accuracy: 0.9897 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt diff --git a/example.py b/example.py new file mode 100644 index 0000000000000000000000000000000000000000..1a406a74a79449dd900a687da6f890bab6321fde --- /dev/null +++ b/example.py @@ -0,0 +1,15 @@ +import numpy as np +from transformers import AutoModel + +# Load sm_subgroup_classifier +sm_classifier = AutoModel.from_pretrained( + "erikhenriksson/sm-subgroup-classifier", trust_remote_code=True +) + +# create a random 1024 dimensional embedding +embedding = np.random.rand(1024).astype(np.float32) + +# Use - model automatically discovers what's available +result = sm_classifier("fi", "NA-nb", embedding) + +print(result) diff --git a/fi_ID-NA/metadata.pkl b/fi_ID-NA/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..25b417ea912e330617b411ee0052d683933893ef --- /dev/null +++ b/fi_ID-NA/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:836ae4c831fe01dd10837795f65517e2768a1b1bd5364187226b09a39044826b +size 64 diff --git a/fi_ID-NA/model.pkl b/fi_ID-NA/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..2823aca7dff361c42d745f593780f48dfd9ed934 --- /dev/null +++ b/fi_ID-NA/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91641ec86de57b7e5bc916dd05cad1bc6189dcd58a67f4f3cc8516af6ac5b228 +size 9055 diff --git a/fi_ID-NA/scaler.pkl b/fi_ID-NA/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..ea727b18a1b91610d8147a306d68f5c56b59e803 --- /dev/null +++ b/fi_ID-NA/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b61d42366ac1a5e42e2924c14aac56e71c18c92670fef5cef8072ae4698c0612 +size 25191 diff --git a/fi_ID-NA/training_details.txt b/fi_ID-NA/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..a0cf8775e99889d3a79d88b08dcf2d56ebcf6ce1 --- /dev/null +++ b/fi_ID-NA/training_details.txt @@ -0,0 +1,39 @@ +Training Details for fi_ID-NA +======================================== + +Language: fi +Register: ID-NA +Training Date: 2025-09-26 14:06:57 + +Data Summary: +- Total samples: 1729 +- Training samples: 1383 +- Test samples: 346 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 2 +- Class names: '', 'comments' +- Class distribution: {'': 389, 'comments': 1340} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.9855595667870036, 0.9927797833935018, 0.9927797833935018, 0.9927536231884058, 0.9818840579710145] +- CV mean: 0.9892 +- CV std: 0.0046 +- CV confidence interval: 0.9892 ± 0.0092 + +Final Performance: +- Test accuracy: 0.9913 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt diff --git a/fi_ID/metadata.pkl b/fi_ID/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..b96486383ecb1891af102facf72247e69b2a1ffd --- /dev/null +++ b/fi_ID/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e193cf54249f175dabf353519ff468ff9b644e995a749d1abb9d45286eaa185b +size 62 diff --git a/fi_ID/model.pkl b/fi_ID/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..03bad920ed5c68bc5bca3c5c23fbe65882c356bd --- /dev/null +++ b/fi_ID/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15dc245f640dd24687143cb21fdedf34968f9de671aec463f8bbc91bec7ea88f +size 9055 diff --git a/fi_ID/scaler.pkl b/fi_ID/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..b94d0fc695fa8ae0406f9d050d24486ad770784c --- /dev/null +++ b/fi_ID/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ed4c1193f133be974168c0f1b02f520aa06f0e056b4f5dd7c8f952cc20a8675 +size 25191 diff --git a/fi_ID/training_details.txt b/fi_ID/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..11617192258989f169b851117ac2ec571a408699 --- /dev/null +++ b/fi_ID/training_details.txt @@ -0,0 +1,39 @@ +Training Details for fi_ID +======================================== + +Language: fi +Register: ID +Training Date: 2025-09-26 14:08:45 + +Data Summary: +- Total samples: 34973 +- Training samples: 27978 +- Test samples: 6995 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 2 +- Class names: '', 'sports' +- Class distribution: {'': 34495, 'sports': 478} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.9980343102215868, 0.9987491065046462, 0.9992852037169406, 0.9987488829311886, 0.9978552278820375] +- CV mean: 0.9985 +- CV std: 0.0005 +- CV confidence interval: 0.9985 ± 0.0010 + +Final Performance: +- Test accuracy: 0.9986 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt diff --git a/fi_NA-nb-OP-rv/metadata.pkl b/fi_NA-nb-OP-rv/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..564d0fcc85a139da755c4277bcc40566b1a078a4 --- /dev/null +++ b/fi_NA-nb-OP-rv/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1febda2186d53eefc99e24613b84c6746d3dfb4d9d938c736199e7a18c55884 +size 91 diff --git a/fi_NA-nb-OP-rv/model.pkl b/fi_NA-nb-OP-rv/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..40bd721c6fad6b37445b8f5da291fb3dc188098e --- /dev/null +++ b/fi_NA-nb-OP-rv/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83cfc695439d258effeb25e30a6677c1c0e18b8d07c3a4e1c36738eac4b800ac +size 33671 diff --git a/fi_NA-nb-OP-rv/scaler.pkl b/fi_NA-nb-OP-rv/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..15594563474c0586b10cd4261b337d31f5353e2c --- /dev/null +++ b/fi_NA-nb-OP-rv/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7694b06950c31c271c8d8c2a03bf252b1b59b2dae800bcfd6ff31c1b4f296919 +size 25191 diff --git a/fi_NA-nb-OP-rv/training_details.txt b/fi_NA-nb-OP-rv/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..73aa7324af1125a4f902e6ba27263f2c18999c54 --- /dev/null +++ b/fi_NA-nb-OP-rv/training_details.txt @@ -0,0 +1,39 @@ +Training Details for fi_NA-nb-OP-rv +======================================== + +Language: fi +Register: NA-nb-OP-rv +Training Date: 2025-09-26 14:06:58 + +Data Summary: +- Total samples: 4929 +- Training samples: 3943 +- Test samples: 986 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 4 +- Class names: 'books', 'dining', 'beverages', 'cosmetics' +- Class distribution: {'books': 2958, 'dining': 294, 'beverages': 283, 'cosmetics': 1394} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.9898605830164765, 0.9936628643852978, 0.9936628643852978, 0.9885786802030457, 0.9911167512690355] +- CV mean: 0.9914 +- CV std: 0.0020 +- CV confidence interval: 0.9914 ± 0.0041 + +Final Performance: +- Test accuracy: 0.9899 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt diff --git a/fi_NA-nb-OP/metadata.pkl b/fi_NA-nb-OP/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..b0852a8be6225ad2e3184ccd823b861f2921f34c --- /dev/null +++ b/fi_NA-nb-OP/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8181ed2154a1e738d8731ba8b6559a50b8d98ff39db75d319023ec18339569f3 +size 77 diff --git a/fi_NA-nb-OP/model.pkl b/fi_NA-nb-OP/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..48bdf1738082fa6b3a1068c34df35944c2cf1ece --- /dev/null +++ b/fi_NA-nb-OP/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f00c094692e5bb83931d54deef16ef5f7b807f0537d15a1ed6345acab21e88f +size 25471 diff --git a/fi_NA-nb-OP/scaler.pkl b/fi_NA-nb-OP/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..a586b8d924d8e38c6ea98e78bf5447b7572b8343 --- /dev/null +++ b/fi_NA-nb-OP/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5dac617f742be37b2fd9976ce2704013ecaa88a3eb69a0c6f1894edd5b2b6434 +size 25191 diff --git a/fi_NA-nb-OP/training_details.txt b/fi_NA-nb-OP/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..58b65f0649b2d5e23c54b972feae7fb78af68bca --- /dev/null +++ b/fi_NA-nb-OP/training_details.txt @@ -0,0 +1,39 @@ +Training Details for fi_NA-nb-OP +======================================== + +Language: fi +Register: NA-nb-OP +Training Date: 2025-09-26 14:06:57 + +Data Summary: +- Total samples: 1969 +- Training samples: 1575 +- Test samples: 394 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 3 +- Class names: '', 'culture', 'consumption' +- Class distribution: {'': 874, 'culture': 695, 'consumption': 400} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.9841269841269841, 0.9936507936507937, 0.9841269841269841, 0.9777777777777777, 0.9650793650793651] +- CV mean: 0.9810 +- CV std: 0.0094 +- CV confidence interval: 0.9810 ± 0.0188 + +Final Performance: +- Test accuracy: 0.9848 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt diff --git a/fi_NA-nb/metadata.pkl b/fi_NA-nb/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..25b417ea912e330617b411ee0052d683933893ef --- /dev/null +++ b/fi_NA-nb/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:836ae4c831fe01dd10837795f65517e2768a1b1bd5364187226b09a39044826b +size 64 diff --git a/fi_NA-nb/model.pkl b/fi_NA-nb/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..e6ef02b289e7c6cb24619a453320cf2f4137dab2 --- /dev/null +++ b/fi_NA-nb/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73957b464aecf86217f464d4db098528d7f7447904f721044e0a93987372e896 +size 9055 diff --git a/fi_NA-nb/scaler.pkl b/fi_NA-nb/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..a2a1d0d10241d4b5b397b311d6199b9520ad8332 --- /dev/null +++ b/fi_NA-nb/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ee14f4b973f3e012477bb168eb62930d29c713bd94ef1f4eccef46f3b32fcca +size 25191 diff --git a/fi_NA-nb/training_details.txt b/fi_NA-nb/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..927d1145a1b51c85af632713d64138dbb92bcaa4 --- /dev/null +++ b/fi_NA-nb/training_details.txt @@ -0,0 +1,39 @@ +Training Details for fi_NA-nb +======================================== + +Language: fi +Register: NA-nb +Training Date: 2025-09-26 14:08:40 + +Data Summary: +- Total samples: 218088 +- Training samples: 174470 +- Test samples: 43618 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 2 +- Class names: '', 'comments' +- Class distribution: {'': 193558, 'comments': 24530} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.9926061787126726, 0.9932939760417264, 0.9922622800481458, 0.9933512924858142, 0.992778128044936] +- CV mean: 0.9929 +- CV std: 0.0004 +- CV confidence interval: 0.9929 ± 0.0008 + +Final Performance: +- Test accuracy: 0.9927 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt diff --git a/modeling_sm_subgroup_classifier.py b/modeling_sm_subgroup_classifier.py new file mode 100644 index 0000000000000000000000000000000000000000..6610f350bee0f5427fc2514ece1eaac5537056f3 --- /dev/null +++ b/modeling_sm_subgroup_classifier.py @@ -0,0 +1,138 @@ +import os +import pickle + +import joblib +import torch +from transformers import PreTrainedModel + +from .configuration_sm_subgroup_classifier import SmSubgroupClassifierConfig + + +class SmSubgroupClassifier(PreTrainedModel): + config_class = SmSubgroupClassifierConfig + + def __init__(self, config): + super().__init__(config) + self.config = config + self._loaded_classifiers = {} + self.model_dir = None + self._available_models = None + + @property + def available_models(self): + """Auto-discover available models""" + if self._available_models is None: + self._available_models = self._discover_available_models() + return self._available_models + + def _discover_available_models(self): + """Scan model directory for available models""" + if not self.model_dir or not os.path.exists(self.model_dir): + return [] + + models = [] + for item in os.listdir(self.model_dir): + item_path = os.path.join(self.model_dir, item) + if os.path.isdir(item_path): + # Verify it's a valid model directory + required_files = ["model.pkl", "scaler.pkl", "metadata.pkl"] + if all( + os.path.exists(os.path.join(item_path, f)) for f in required_files + ): + models.append(item) + + return sorted(models) + + def _load_classifier(self, model_key): + """Load a specific classifier by model key (e.g., 'en_OP-ob')""" + if model_key in self._loaded_classifiers: + return self._loaded_classifiers[model_key] + + if model_key not in self.available_models: + raise ValueError( + f"Model '{model_key}' not available. Available: {self.available_models}" + ) + + # Path to classifier + classifier_path = os.path.join(self.model_dir, model_key) + if not os.path.exists(classifier_path): + raise FileNotFoundError(f"Classifier not found at {classifier_path}") + + # Load components + classifier = joblib.load(os.path.join(classifier_path, "model.pkl")) + scaler = joblib.load(os.path.join(classifier_path, "scaler.pkl")) + with open(os.path.join(classifier_path, "metadata.pkl"), "rb") as f: + metadata = pickle.load(f) + + classifier_info = { + "classifier": classifier, + "scaler": scaler, + "class_names": metadata["class_names"], + } + + self._loaded_classifiers[model_key] = classifier_info + return classifier_info + + def forward(self, language, model_name, embeddings): + """ + Args: + language: Language code (en, fi, sv) + model_name: Model name (OP-ob, NA, etc.) + embeddings: Pre-computed embeddings + """ + # Create model key + model_key = f"{language}_{model_name}" + + # Convert embeddings to numpy if needed + if torch.is_tensor(embeddings): + embeddings = embeddings.detach().cpu().numpy() + if embeddings.ndim == 1: + embeddings = embeddings.reshape(1, -1) + + # Load classifier + classifier_info = self._load_classifier(model_key) + + # Scale and predict + embeddings_scaled = classifier_info["scaler"].transform(embeddings) + predictions = classifier_info["classifier"].predict(embeddings_scaled) + probabilities = classifier_info["classifier"].predict_proba(embeddings_scaled) + + # Format results - just use class names and probabilities + results = [] + for pred, probs in zip(predictions, probabilities): + predicted_class_name = classifier_info["class_names"][pred] + # Get all class probabilities + all_probs = { + classifier_info["class_names"][i]: float(prob) + for i, prob in enumerate(probs) + } + results.append( + { + "label": predicted_class_name, + "probabilities": all_probs, + } + ) + + return results[0] if len(results) == 1 else results + + @classmethod + def from_pretrained(cls, pretrained_model_name_or_path, **kwargs): + # Load config + config = SmSubgroupClassifierConfig.from_pretrained( + pretrained_model_name_or_path, **kwargs + ) + + # Create model instance (skip the pytorch weight loading) + model = cls(config) + + # For HF Hub, we need to resolve to the actual cached directory + try: + from huggingface_hub import snapshot_download + + # Download/get the cached directory path + model.model_dir = snapshot_download(pretrained_model_name_or_path) + except ImportError: + # Fallback if huggingface_hub not available + model.model_dir = pretrained_model_name_or_path + + return model diff --git a/sv_HI-NA-nb-re/metadata.pkl b/sv_HI-NA-nb-re/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..2e8131130c8fb514dd5bacf9b1d27c9cb6e996fe --- /dev/null +++ b/sv_HI-NA-nb-re/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a0f52bdc3d0252e9176382affb050c74fa24ed744785573a67ae28cdb9d785f +size 62 diff --git a/sv_HI-NA-nb-re/model.pkl b/sv_HI-NA-nb-re/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..6723e21cecee03ca2d1bb7ddbfb0bb51253457f6 --- /dev/null +++ b/sv_HI-NA-nb-re/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45b36afa0b2d6b74474f7ec1ae3779322e637f64af1bfe522083fe356a22a194 +size 9055 diff --git a/sv_HI-NA-nb-re/scaler.pkl b/sv_HI-NA-nb-re/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..56adb6893ae971b2bd79a759879b3f2c9de1917b --- /dev/null +++ b/sv_HI-NA-nb-re/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7732e98d25e09a32de626c8996637f3e844deb95f1495a77e72cd6cc957da2f4 +size 25191 diff --git a/sv_HI-NA-nb-re/training_details.txt b/sv_HI-NA-nb-re/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..e1622439114dd6c74a462807f37c160e7665923b --- /dev/null +++ b/sv_HI-NA-nb-re/training_details.txt @@ -0,0 +1,39 @@ +Training Details for sv_HI-NA-nb-re +======================================== + +Language: sv +Register: HI-NA-nb-re +Training Date: 2025-09-26 14:05:16 + +Data Summary: +- Total samples: 6804 +- Training samples: 5443 +- Test samples: 1361 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 2 +- Class names: 'crafts', '' +- Class distribution: {'crafts': 135, '': 6669} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.9963269054178145, 0.9963269054178145, 0.9972451790633609, 0.9944852941176471, 0.9954044117647058] +- CV mean: 0.9960 +- CV std: 0.0009 +- CV confidence interval: 0.9960 ± 0.0019 + +Final Performance: +- Test accuracy: 0.9956 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt diff --git a/sv_ID-NA-nb/metadata.pkl b/sv_ID-NA-nb/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..25b417ea912e330617b411ee0052d683933893ef --- /dev/null +++ b/sv_ID-NA-nb/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:836ae4c831fe01dd10837795f65517e2768a1b1bd5364187226b09a39044826b +size 64 diff --git a/sv_ID-NA-nb/model.pkl b/sv_ID-NA-nb/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..1b7be91346214ea5fd3759d35736c433895c9083 --- /dev/null +++ b/sv_ID-NA-nb/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3e6a7f1c0e31e315d84e43bc75299c48fe02215b7def50de7fc350316f807cb +size 9055 diff --git a/sv_ID-NA-nb/scaler.pkl b/sv_ID-NA-nb/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..6cfb01508b5b7b23e31dd37c0683e376174ace64 --- /dev/null +++ b/sv_ID-NA-nb/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0321f17c25e743d5a5318c5011f9b6bdbe864aa683f9ff00d7bc2a6efc28cbb +size 25191 diff --git a/sv_ID-NA-nb/training_details.txt b/sv_ID-NA-nb/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..ce228f48f4dd9785d69ff3d1c1d01649e84c2207 --- /dev/null +++ b/sv_ID-NA-nb/training_details.txt @@ -0,0 +1,39 @@ +Training Details for sv_ID-NA-nb +======================================== + +Language: sv +Register: ID-NA-nb +Training Date: 2025-09-26 14:05:20 + +Data Summary: +- Total samples: 1189 +- Training samples: 951 +- Test samples: 238 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 2 +- Class names: '', 'comments' +- Class distribution: {'': 852, 'comments': 337} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.9214659685863874, 0.9526315789473684, 0.9315789473684211, 0.968421052631579, 0.9263157894736842] +- CV mean: 0.9401 +- CV std: 0.0177 +- CV confidence interval: 0.9401 ± 0.0354 + +Final Performance: +- Test accuracy: 0.9706 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt diff --git a/sv_ID/metadata.pkl b/sv_ID/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..b7a74dc4067a5085383bae5e4e2c052c363ba33e --- /dev/null +++ b/sv_ID/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21413604878beb792fbc2f549db7a71b67cfaaca8200989e74e5df69a0e6c7b1 +size 69 diff --git a/sv_ID/model.pkl b/sv_ID/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..06dab85584c3ac388633f249151cba2767f4689a --- /dev/null +++ b/sv_ID/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f22126201e503512b9bbf51ed4c310d6e59ae89dd12e37835154c15a382d2612 +size 25471 diff --git a/sv_ID/scaler.pkl b/sv_ID/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..4ed51c1378523d1b5410146208e08ca16d07d1e2 --- /dev/null +++ b/sv_ID/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f5634d9ac1f9b6a3d8e303ca1a929f6ade9ac33f1acdf697ae765a60646fd66 +size 25191 diff --git a/sv_ID/training_details.txt b/sv_ID/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..b218cb7bad5b35e9d16da4651a8385c24301a87a --- /dev/null +++ b/sv_ID/training_details.txt @@ -0,0 +1,39 @@ +Training Details for sv_ID +======================================== + +Language: sv +Register: ID +Training Date: 2025-09-26 14:06:57 + +Data Summary: +- Total samples: 15060 +- Training samples: 12048 +- Test samples: 3012 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 3 +- Class names: '', 'sports', 'help' +- Class distribution: {'': 14108, 'sports': 542, 'help': 410} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.9962655601659751, 0.9954356846473029, 0.9983402489626556, 1.0, 0.9991697799916978] +- CV mean: 0.9978 +- CV std: 0.0017 +- CV confidence interval: 0.9978 ± 0.0035 + +Final Performance: +- Test accuracy: 0.9977 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt diff --git a/sv_IN-NA-nb/metadata.pkl b/sv_IN-NA-nb/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..8e5f2e112eb6c8b9f360c3fa24ff88907aac96e5 --- /dev/null +++ b/sv_IN-NA-nb/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd3eb5a1c95ad8f91592fdd378fcdd09122c1c4ff610517b88c9b80626933fe7 +size 69 diff --git a/sv_IN-NA-nb/model.pkl b/sv_IN-NA-nb/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..a5957f2d4b673fe0980c19a428508470eb3db1d5 --- /dev/null +++ b/sv_IN-NA-nb/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3247c4a22da33aab41f2e67513baa5a91675fb48eca867774eb3eb23c08bb827 +size 9055 diff --git a/sv_IN-NA-nb/scaler.pkl b/sv_IN-NA-nb/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..384cb4f86240ed978d873868b01699f802af7c2a --- /dev/null +++ b/sv_IN-NA-nb/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f803cf9ff62e705c6f25bd9f553ee451df2c94a451cfc044d86753e303c8b5c5 +size 25191 diff --git a/sv_IN-NA-nb/training_details.txt b/sv_IN-NA-nb/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..c3e818bdf31dab4760fb57e61c92ad270c9db4ee --- /dev/null +++ b/sv_IN-NA-nb/training_details.txt @@ -0,0 +1,39 @@ +Training Details for sv_IN-NA-nb +======================================== + +Language: sv +Register: IN-NA-nb +Training Date: 2025-09-26 14:05:18 + +Data Summary: +- Total samples: 1169 +- Training samples: 935 +- Test samples: 234 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 2 +- Class names: '', 'organizations' +- Class distribution: {'': 811, 'organizations': 358} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.93048128342246, 0.9893048128342246, 0.9625668449197861, 0.9679144385026738, 0.9625668449197861] +- CV mean: 0.9626 +- CV std: 0.0188 +- CV confidence interval: 0.9626 ± 0.0377 + +Final Performance: +- Test accuracy: 0.9744 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt diff --git a/sv_NA-nb-OP-rv/metadata.pkl b/sv_NA-nb-OP-rv/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..df435e407578fe40ae064f66da9ae8efbbe5ecc3 --- /dev/null +++ b/sv_NA-nb-OP-rv/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7cb960aca3e7a21c0b1c73a32eaa7e732fb968b10cacf031fa28559f79741dc9 +size 72 diff --git a/sv_NA-nb-OP-rv/model.pkl b/sv_NA-nb-OP-rv/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..642b2cd360a6c0da2ef0e9f63a54d2e7e53d0e20 --- /dev/null +++ b/sv_NA-nb-OP-rv/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:682ff2cca0e847dba7ab531629e37efb7ad74f9ec844a584863d6ff6494608ca +size 9055 diff --git a/sv_NA-nb-OP-rv/scaler.pkl b/sv_NA-nb-OP-rv/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..497d6b541eb933a28b5eeb70664e51d6759d72e9 --- /dev/null +++ b/sv_NA-nb-OP-rv/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d405ab5ebe734e6cb9a8f1b86bba6a00ffe6b37c4bea49b43fac56be6fd2d3fa +size 25191 diff --git a/sv_NA-nb-OP-rv/training_details.txt b/sv_NA-nb-OP-rv/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..a35724b9a60678d136676b69509197df1aa34a78 --- /dev/null +++ b/sv_NA-nb-OP-rv/training_details.txt @@ -0,0 +1,39 @@ +Training Details for sv_NA-nb-OP-rv +======================================== + +Language: sv +Register: NA-nb-OP-rv +Training Date: 2025-09-26 14:05:20 + +Data Summary: +- Total samples: 9422 +- Training samples: 7537 +- Test samples: 1885 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 2 +- Class names: 'lifestyle', 'culture' +- Class distribution: {'lifestyle': 2731, 'culture': 6691} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.9927055702917772, 0.9953580901856764, 0.9940278699402787, 0.9960185799601858, 0.9946914399469144] +- CV mean: 0.9946 +- CV std: 0.0011 +- CV confidence interval: 0.9946 ± 0.0023 + +Final Performance: +- Test accuracy: 0.9952 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt diff --git a/sv_NA-nb-OP/metadata.pkl b/sv_NA-nb-OP/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..dc6ea1ecfe9e34a4c77cf19cd6fb2637b0efe1fb --- /dev/null +++ b/sv_NA-nb-OP/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bbf430c9060259c0f0b0f25b5a7d4d5a8d3a3f00dfae891792d6921ac408e382 +size 63 diff --git a/sv_NA-nb-OP/model.pkl b/sv_NA-nb-OP/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..64bf96a1f54f85195a9f85aeb6861ca851e3db39 --- /dev/null +++ b/sv_NA-nb-OP/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:720fc8f577288692a18f9ea11fde030737470791c5f91fc0b1c298d03f673fd1 +size 9055 diff --git a/sv_NA-nb-OP/scaler.pkl b/sv_NA-nb-OP/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..8c7a36cf3f7bd49a8db213ea2411c4a3063af0cd --- /dev/null +++ b/sv_NA-nb-OP/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3597ca98f273cdee567d10ab769fdf0841526d8571bf706130c609c0545fc052 +size 25191 diff --git a/sv_NA-nb-OP/training_details.txt b/sv_NA-nb-OP/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..6439c07e8f8687e370570b38f7afdee5fad6d794 --- /dev/null +++ b/sv_NA-nb-OP/training_details.txt @@ -0,0 +1,39 @@ +Training Details for sv_NA-nb-OP +======================================== + +Language: sv +Register: NA-nb-OP +Training Date: 2025-09-26 14:05:18 + +Data Summary: +- Total samples: 6280 +- Training samples: 5024 +- Test samples: 1256 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 2 +- Class names: 'finance', '' +- Class distribution: {'finance': 149, '': 6131} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.9960199004975124, 0.9950248756218906, 0.9980099502487563, 0.9960199004975124, 0.9950199203187251] +- CV mean: 0.9960 +- CV std: 0.0011 +- CV confidence interval: 0.9960 ± 0.0022 + +Final Performance: +- Test accuracy: 0.9960 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt diff --git a/sv_NA-nb/metadata.pkl b/sv_NA-nb/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..25b417ea912e330617b411ee0052d683933893ef --- /dev/null +++ b/sv_NA-nb/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:836ae4c831fe01dd10837795f65517e2768a1b1bd5364187226b09a39044826b +size 64 diff --git a/sv_NA-nb/model.pkl b/sv_NA-nb/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..1dcc71ecd139a1d6d81b8475f18a54b49f5d39c1 --- /dev/null +++ b/sv_NA-nb/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abe83ba75d6108719e90f50a6eef1aa4012c90e1fb8563ae31c098bc5608d7ac +size 9055 diff --git a/sv_NA-nb/scaler.pkl b/sv_NA-nb/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..2085a601f8fb7a362dd6661515e78ea97553e335 --- /dev/null +++ b/sv_NA-nb/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6c4b5fbd15f2757c77125e111b1326b766ae42739a7f81e5f50b4097782f983 +size 25191 diff --git a/sv_NA-nb/training_details.txt b/sv_NA-nb/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..1197af6c7f69c7d4984bb7425fdebe2e27287d42 --- /dev/null +++ b/sv_NA-nb/training_details.txt @@ -0,0 +1,39 @@ +Training Details for sv_NA-nb +======================================== + +Language: sv +Register: NA-nb +Training Date: 2025-09-26 14:06:54 + +Data Summary: +- Total samples: 222925 +- Training samples: 178340 +- Test samples: 44585 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 2 +- Class names: '', 'comments' +- Class distribution: {'': 203958, 'comments': 18967} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.99290680722216, 0.9922339351799933, 0.9935516429292363, 0.9936918246046876, 0.993523606594146] +- CV mean: 0.9932 +- CV std: 0.0005 +- CV confidence interval: 0.9932 ± 0.0011 + +Final Performance: +- Test accuracy: 0.9940 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt diff --git a/sv_NA-ob-OP/metadata.pkl b/sv_NA-ob-OP/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..7ce95458bf9ad94acd98d9a0a896506680f0df14 --- /dev/null +++ b/sv_NA-ob-OP/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e43bdea690b901743ce3a6a58ff3598aaa6c53830527eafb3b1954c06f6874df +size 69 diff --git a/sv_NA-ob-OP/model.pkl b/sv_NA-ob-OP/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..027020dc028c63edb54de778d7182d236df53838 --- /dev/null +++ b/sv_NA-ob-OP/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4508c12d8e95a73bc9d7e742f2b67e1bb5051b4480937f8597f94bf95d782cd3 +size 9055 diff --git a/sv_NA-ob-OP/scaler.pkl b/sv_NA-ob-OP/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..04d03e04afd8e38eba5415ecc74bfcb1ebf16a92 --- /dev/null +++ b/sv_NA-ob-OP/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e99799e3c3bd2414854f50b699baf7a28da880a06acf53f0fef5e579737981e +size 25191 diff --git a/sv_NA-ob-OP/training_details.txt b/sv_NA-ob-OP/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..fd12ba8d4a42abe9b4578c5b1ffea34aadfdd59b --- /dev/null +++ b/sv_NA-ob-OP/training_details.txt @@ -0,0 +1,39 @@ +Training Details for sv_NA-ob-OP +======================================== + +Language: sv +Register: NA-ob-OP +Training Date: 2025-09-26 14:05:17 + +Data Summary: +- Total samples: 2830 +- Training samples: 2264 +- Test samples: 566 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 2 +- Class names: 'sports', 'general' +- Class distribution: {'sports': 175, 'general': 2655} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.9933774834437086, 0.9933774834437086, 0.9955849889624724, 0.9955849889624724, 0.9911504424778761] +- CV mean: 0.9938 +- CV std: 0.0017 +- CV confidence interval: 0.9938 ± 0.0033 + +Final Performance: +- Test accuracy: 0.9929 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt diff --git a/sv_ds-IP-NA-nb/metadata.pkl b/sv_ds-IP-NA-nb/metadata.pkl new file mode 100644 index 0000000000000000000000000000000000000000..e8ba02711a7373655642c3cd5ddbe7a0816bad49 --- /dev/null +++ b/sv_ds-IP-NA-nb/metadata.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35744024c4a607858cf573d71fecdab5e8dd04f69a3aa16b60c3a9b6ceb93961 +size 73 diff --git a/sv_ds-IP-NA-nb/model.pkl b/sv_ds-IP-NA-nb/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..c481b26fa26e3f58e04f405839de063d0e20c39f --- /dev/null +++ b/sv_ds-IP-NA-nb/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:984ebee2366c6b4ea8c0883fd66e5095f4fbeacb91fbea6ecd5b9dc90a184c99 +size 25471 diff --git a/sv_ds-IP-NA-nb/scaler.pkl b/sv_ds-IP-NA-nb/scaler.pkl new file mode 100644 index 0000000000000000000000000000000000000000..50f55c3ce880750d9fc2a01f0749d8aa7f949a2f --- /dev/null +++ b/sv_ds-IP-NA-nb/scaler.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d945f837c7bb8de0be3cbd8d449af27d4577ae2a813fa0ad18218a576dd2105 +size 25191 diff --git a/sv_ds-IP-NA-nb/training_details.txt b/sv_ds-IP-NA-nb/training_details.txt new file mode 100644 index 0000000000000000000000000000000000000000..561d5bde77cced8c3633a3dbb91d5194bece9f31 --- /dev/null +++ b/sv_ds-IP-NA-nb/training_details.txt @@ -0,0 +1,39 @@ +Training Details for sv_ds-IP-NA-nb +======================================== + +Language: sv +Register: ds-IP-NA-nb +Training Date: 2025-09-26 14:05:17 + +Data Summary: +- Total samples: 2357 +- Training samples: 1885 +- Test samples: 472 +- Embedding dimension: 1024 + +Classes: +- Number of classes: 3 +- Class names: '', 'travel', 'contests' +- Class distribution: {'': 1933, 'travel': 268, 'contests': 156} + +Cross-Validation Results: +- CV folds: 5 +- CV scores: [0.9761273209549072, 0.9840848806366048, 0.9840848806366048, 0.9761273209549072, 0.9893899204244032] +- CV mean: 0.9820 +- CV std: 0.0051 +- CV confidence interval: 0.9820 ± 0.0103 + +Final Performance: +- Test accuracy: 0.9788 + +Model Configuration: +- Algorithm: Logistic Regression +- Regularization (C): 1.0 +- Feature scaling: StandardScaler +- Random state: 42 + +Files: +- Classifier: model.pkl +- Scaler: scaler.pkl +- Metadata: metadata.pkl +- This file: training_details.txt