spam_detection.train()
Fine-tunes a pre-trained Spam Detection model on user-specified instructions. No training data
is needed, as the model uses synthex.jobs.generate_data() under the
hood to generate a synthetic training dataset based on the provided instructions.
Both the base Spam Detection model tanaos/tanaos-spam-detection-v1 and previously trained models can be further trained using this method:
- Fine-tune the base Spam Detection model:
Artifex().spam_detection.train() - Fine-tune a model that was previously trained with Artifex, in order to train it further:
Artifex().spam_detection.load("trained/model/path").train()
Arguments
- spam_content list[str]
A list of strings, where each string describes a type of content that should be classified as"spam"by the spam detection model. - output_path stroptional
A string which specifies the path where the output files will be generated. The output files consist of:- The training dataset
- The output model
safetensorand configuration files
- num_samples intoptionaldefault: 500
An integer which specifies the number of datapoints that the synthetic training dataset should consist of, and that the model will be trained on. The maximum number of datapoints you can train your model on depends on whether you are on a free or paid plan. - num_epochs stroptionaldefault: 3
An integer which specifies the number of epochs to train the model for.
- Python
from artifex import Artifex
spam_detection = Artifex().spam_detection
spam_detection.train(
spam_content=[
"Unsolicited commercial advertisement or non-commercial proselytizing",
"Fraudulent schemes, including get-rich-quick and pyramid schemes",
"Phishing attempts, unrealistic offers or announcements",
"Content with deceptive or misleading information",
"Malware or harmful links",
"Adult content or explicit material",
"Excessive use of capitalization or punctuation to grab attention",
]
)
- Response
None