Skip to content

Commit 36c2d02

Browse files
committed
Added probability to hat detection
1 parent a5bda70 commit 36c2d02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Fritz.Chatbot/Commands/PredictHatCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ public async Task Execute(IChatService chatService, string userName, ReadOnlyMem
8888

8989
var guess1Data = (await _Repository.GetHatData(bestMatch.TagName));
9090
var guess2Data = (await _Repository.GetHatData(result.Predictions.OrderByDescending(p => p.Probability).Skip(1).First().TagName));
91-
await chatService.SendMessageAsync($"csharpGuess I'm not quite sure if this is {guess1Data.Name} or {guess2Data.Name}");
91+
await chatService.SendMessageAsync($"csharpGuess I'm not quite sure if this is {guess1Data.Name} ({bestMatch.Probability.ToString("0.0%")}) or {guess2Data.Name} ({result.Predictions.OrderByDescending(p => p.Probability).Skip(1).First().Probability.ToString("0.0%")})");
9292
return;
9393

9494
} else {
9595
var guessData = (await _Repository.GetHatData(bestMatch.TagName));
96-
await chatService.SendMessageAsync($"csharpGuess I'm not quite sure if this is {guessData.Name}");
96+
await chatService.SendMessageAsync($"csharpGuess I'm not quite sure if this is {guessData.Name} ({bestMatch.Probability.ToString("0.0%")})");
9797
return;
9898
}
9999

0 commit comments

Comments
 (0)