INNER CODE UNIT · Python

get_attack_id

center-for-threat-informed-defense/tram · src/scripts/reformat_training_data.py:253

def get_attack_id(description):
    """Given a description, get the ATTACK ID. Raises IndexError if the retrieval fails."""
    lower_description = description.lower()
    attack_id = ATTACK_LOOKUP[lower_description]
    return attack_id


def main():
    with open("data/training/archive/all_analyzed_reports.json") as f:
        all_analyzed_reports = json.load(f)

    with open("data/training/archive/negative_data.json") as f:
        negative_data = json.load(f)

    training_data = TrainingData()

    # Add the positives
    for key, value in all_analyzed_reports.items():

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…