package com.sino.mci.inbound.intent;

import lombok.Data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 意图识别结果。
 */
@Data
public class IntentResult {

    private String intent;
    private double confidence;
    private Map<String, String> slots;
    private List<String> missingSlots;
    private boolean requiresConfirmation;

    public IntentResult() {
        this.slots = new HashMap<>();
        this.missingSlots = new ArrayList<>();
    }

    public IntentResult(String intent, double confidence, Map<String, String> slots,
                        List<String> missingSlots, boolean requiresConfirmation) {
        this.intent = intent;
        this.confidence = confidence;
        this.slots = slots != null ? slots : new HashMap<>();
        this.missingSlots = missingSlots != null ? missingSlots : new ArrayList<>();
        this.requiresConfirmation = requiresConfirmation;
    }
}
