Augmentedsocialscientist

Latest version: v2.2.1

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

Scan your dependencies

Page 1 of 2

2.2.1

Change model saving pattern: now existing folders will overwritten

2.2.0

add `self.load_model()` method to load a locally saved model

2.1.0

add a parameter (add_special_tokens: bool) to encode

2.0.2

add type hints

2.0.1

Fix bug for "unexpected argument model_name" when using a custom model from hugging face

2.0.0

The package is rewritten in an object-oriented way for more readability, extensibility and flexibility.

1. All models are grouped together in the module `AugmentedSocialScientist.models`

To use a model (see README for the list)
python
from AugmentedSocialScientist.models import Bert

bert = Bert() instanciation

Everything else remains unchanged for users to train a model: `bert.encode()` to preprocess data, `bert.run_training()` to train, validate and save a model, `bert.predict_with_model()` to make predictions.


2. Flexibility
- To use a custom model from Hugging Face, set the `model_name` argument while instantiating the model
For example, to use the Danish BERT model from Hugging Face [DJSammy/bert-base-danish-uncased_BotXO-ai](https://huggingface.co/DJSammy/bert-base-danish-uncased_BotXO-ai).
python
from AugmentedSocialScientist.models import Bert

bert = Bert(model_name="DJSammy/bert-base-danish-uncased_BotXO-ai")

- Users can now set their own device to use, by providing a custom a `torch.Device` object to the `device` argument when instantiating the model.

python
from AugmentedSocialScientist.models import Bert

bert = Bert(device=...) your own device


3. The input classification labels can also be textual labels now. They will be automatically converted to the corresponding label ids (integers starting from 0) by the method `encode()`. The dictionary of labels `{label_name:label_id}` will be printed during the preprocessing and saved to the attribute `self.dict_labels`.

4. All dependancies on tensorflow and keras are removed.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.