Skip to content

Commit

Permalink
Merge pull request #45 from just-ai/caila-state-selection-context
Browse files Browse the repository at this point in the history
0.6.1 - fix CailaIntentActivator state recognition
  • Loading branch information
Denire authored Sep 10, 2020
2 parents e6271bb + 9de6866 commit 17d612f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.justai.jaicf.api.hasQuery
import com.justai.jaicf.context.ActivatorContext
import com.justai.jaicf.context.BotContext
import com.justai.jaicf.model.scenario.ScenarioModel
import com.justai.jaicf.model.state.StatePath
import com.justai.jaicf.reactions.Reactions
import com.justai.jaicf.slotfilling.SlotFillingResult
import com.justai.jaicf.slotfilling.SlotReactor
Expand Down Expand Up @@ -53,7 +54,13 @@ class CailaIntentActivator(
}
}
// Sort all predicted intents by context relevance
.sortedByDescending { botContext.dialogContext.currentState.commonPrefixWith(it.first) }
.sortedByDescending {
var currentState = botContext.dialogContext.currentState
if (currentState == it.first) {
currentState = StatePath.parse(currentState).stepUp().toString()
}
currentState.commonPrefixWith(it.first)
}
.groupBy { it.first }

// From most relevant by context take intent with maximum confidence.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ buildscript {
allprojects {

group = "com.justai.jaicf"
version = "0.6.0"
version = "0.6.1"

repositories {
google()
Expand Down

0 comments on commit 17d612f

Please sign in to comment.