INNER CODE UNIT · Python
_split_into_train_and_evaluation_data
dragondrop-cloud/cloud-concierge · nlpengine/main.py:164
def _split_into_train_and_evaluation_data(training_data_examples: List) -> dict:
"""
Splits the training and evaluation data out of training_data_examples with an 80/20 train/eval split.
"""
train_set_cutoff = int(len(training_data_examples) * 0.8)
shuffle(training_data_examples)
return {
"train": training_data_examples[:train_set_cutoff],
"evaluate": training_data_examples[train_set_cutoff:],
}
def _initialize_classification_model(nlp: spacy.Language, initial_examples) -> Union:
"""Initialize the multi-label classification model."""
config = {
"threshold": 0.5,