-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding confidence score to entities and topic responses (#460)
* Adding confidence score to entities and topic responses * Adding labels and fixing UTS * Adding utils * Fixing UT * Remove unused imports * Updating topic classifier --------- Co-authored-by: dristy.cd <[email protected]>
- Loading branch information
1 parent
28493cd
commit 2465160
Showing
13 changed files
with
293 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
Copyright (c) 2024 Cloud Defense, Inc. All rights reserved. | ||
""" | ||
|
||
from enum import Enum | ||
|
||
|
||
class ConfidenceScoreLabel(Enum): | ||
HIGH = "HIGH" | ||
MEDIUM = "MEDIUM" | ||
LOW = "LOW" | ||
|
||
|
||
def get_confidence_score_label(confidence_score): | ||
if float(confidence_score) >= 0.8: | ||
return ConfidenceScoreLabel.HIGH.value | ||
elif 0.4 <= float(confidence_score) < 0.8: | ||
return ConfidenceScoreLabel.MEDIUM.value | ||
else: | ||
return ConfidenceScoreLabel.LOW.value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.