Ktrain

Latest version: v0.41.4

Safety actively analyzes 640986 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 10 of 29

0.26.3

New:
- N/A

Changed
- `shallownlp.ner.NER.predict` processes lists of sentences in batches resulting in faster predictions
- `batch_size` argument added to `shallownlp.ner.NER.predict`
- added `verbose` parameter to `ktrain.text.textutils.extract_copy` to optionally see why each skipped document was skipped

Fixed:
- Changed `TextPredictor.save` to save Hugging Face tokenizer files locally to ensure they can be easily reloaded when `text.Transformer` is supplied with local path.
- For `transformers` models, the `predictor.preproc.model_name` variable is automatically updated to be new `Predictor` folder to avoid having users manually update `model_name`. Applies
when a local path is supplied to `text.Transformer` and resultant `Predictor` is moved to new machine.

0.26.2

New:
- N/A

Changed
- `NERPredictor.predict` now optionally accepts lists of sentences to make sequence-labeling predictions in batches (as all other `Predictor` instances already do).

Fixed:
- N/A

0.26.1

New:
- N/A

Changed
- expose errors from `transformers` in `_load_pretrained`
- Changed `TextPreprocessor.check_trained` to be a warning instead of Exception

Fixed:
- N/A

0.26.0

New:
- Support for **transformers** 4.0 and above.

Changed
- added `set_tokenizer to `TransformerPreprocessor`
- show error message when original weights cannot be saved (for `reset_weights` method)

Fixed:
- cast filename to string before concatenating with suffix in `images_from_csv` and `images_from_df` (addresses issue 330)
- resolved import error for `sklearn>=0.24.0`, but `eli5` still requires `sklearn<0.24.0`.

0.25.4

New:
- N/A

Changed
- N/A

Fixed:
- fixed problem with `LabelEncoder` not properly being stored when `texts_from_df` is invoked
- refrain from invoking `max` on empty sequence (307)
- corrected issue with `return_proba=True` in NER predictions (316)

0.25.3

New:
- N/A

Changed
- A `steps_per_epoch` argument has been added to all `*fit*` methods that operate on generators
- Added `get_tokenizer` methods to all instances of `TextPreprocessor`

Fixed:
- propogate custom metrics to model when `distilbert` is chosen in `text_classifier` and `text_regression_model` functions
- pin `scikit-learn` to 0.24.0 sue to breaking change

Page 10 of 29

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.