# Path: tupa/config.py
# FORMATS = ["ucca"] + list(CONVERTERS)
# 
# Path: tupa/model.py
# NODE_LABEL_KEY = "n"
# 
# Path: tupa/scripts/export.py
# def load_model(filename):
#     model = Model(filename=filename)
#     model.load()
#     return model


import os
from configargparse import ArgParser
from tupa.config import FORMATS
from tupa.model import NODE_LABEL_KEY
from tupa.scripts.export import load_model



def strip_multitask(model, keep):
    if "amr" not in keep:  # Remove AMR-specific features: node label and category
        delete_if_exists((model.feature_params, model.classifier.params), (NODE_LABEL_KEY, "c"))

# Path: tupa/config.py
# FORMATS = ["ucca"] + list(CONVERTERS)
# 
# Path: tupa/model.py
# NODE_LABEL_KEY = "n"
# 
# Path: tupa/scripts/export.py
# def load_model(filename):
#     model = Model(filename=filename)
#     model.load()
#     return model


# Path: tupa/scripts/strip_multitask.py
import os
from configargparse import ArgParser
from tupa.config import FORMATS
from tupa.model import NODE_LABEL_KEY
from tupa.scripts.export import load_model




def strip_multitask(model, keep):
    if "amr" not in keep:  # Remove AMR-specific features: node label and category
        delete_if_exists((model.feature_params, model.classifier.params), (NODE_LABEL_KEY, "c"))

    delete_if_exists((model.classifier.labels, model.classifier.axes), {NODE_LABEL_KEY}.union(FORMATS).difference(keep))