bertuner 0.2.0__tar.gz → 0.2.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bertuner
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Hyperparameter optimization and fine-tuning for BERT-style text classifiers (Optuna + MLflow), with long-context ModernBERT support
5
5
  Author-email: elemets <alafunnell@gmail.com>
6
6
  License: MIT
@@ -112,6 +112,17 @@ class BERTuneClassifier:
112
112
  self.target_cols = target_cols
113
113
  self.seed = seed
114
114
  self.df = pd.read_csv(data_path) if data_path is not None else dataframe.copy()
115
+ # Missing/NaN text values are coerced to empty strings so tokenization
116
+ # does not error on non-string inputs. Warn so callers know rows were
117
+ # altered rather than dropped.
118
+ n_missing = int(self.df[text_feature].isna().sum())
119
+ if n_missing:
120
+ warnings.warn(
121
+ f"{n_missing} missing (NaN) value(s) in text column "
122
+ f"'{text_feature}' were replaced with empty strings.",
123
+ stacklevel=2,
124
+ )
125
+ self.df[text_feature] = self.df[text_feature].fillna("").astype(str)
115
126
  if num_labels is not None:
116
127
  self.num_labels = num_labels
117
128
  elif self.is_multilabel:
@@ -1,6 +1,6 @@
1
1
  """bertuner: hyperparameter optimization and fine-tuning for BERT-style text classifiers."""
2
2
 
3
- __version__ = "0.2.0"
3
+ __version__ = "0.2.1"
4
4
 
5
5
  from bertuner.BERTuner import BERTuneClassifier
6
6
  from bertuner.Predictor import BERTunePredictor
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bertuner
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Hyperparameter optimization and fine-tuning for BERT-style text classifiers (Optuna + MLflow), with long-context ModernBERT support
5
5
  Author-email: elemets <alafunnell@gmail.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "bertuner"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "Hyperparameter optimization and fine-tuning for BERT-style text classifiers (Optuna + MLflow), with long-context ModernBERT support"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes