com.justai.jaicf.activator.caila.slotfilling.CailaSlotFillingContext.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of caila Show documentation
Show all versions of caila Show documentation
JAICF-Kotlin Caila NLU Activator Adapter. Provides intent recognition and named entity extraction.
package com.justai.jaicf.activator.caila.slotfilling
import com.justai.jaicf.activator.caila.caila
import com.justai.jaicf.activator.caila.dto.CailaEntityMarkupData
import com.justai.jaicf.activator.caila.dto.CailaKnownSlotData
import com.justai.jaicf.activator.caila.dto.CailaSlotData
import com.justai.jaicf.context.ActivatorContext
import java.io.Serializable
internal data class CailaSlotFillingContext(
val initialActivatorContext: ActivatorContext,
val slots: List,
val knownSlots: MutableList,
val knownEntities: MutableList,
val maxRetries: MutableMap = HashMap()
) : Serializable {
companion object Factory {
fun createInitial(initial: ActivatorContext): CailaSlotFillingContext {
val knownSlots = initial.caila?.result?.inference?.variants?.get(0)?.slots?.toMutableList()
?: mutableListOf()
val knownEntities = initial.caila?.entities?.toMutableList()
?: mutableListOf()
val requiredSlots = initial.caila?.topIntent?.slots?.toMutableList()
?: mutableListOf()
val maxRetries = initial.caila?.topIntent?.slots?.map { it.name to 0 }?.toMap()?.toMutableMap()
?: mutableMapOf()
return CailaSlotFillingContext(
initialActivatorContext = initial,
knownSlots = knownSlots,
knownEntities = knownEntities,
slots = requiredSlots,
maxRetries = maxRetries
)
}
private const val serialVersionUID = 6691290642221965774L
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy