mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-03-30 04:31:49 +02:00
avoid boost_score > 1.0
This commit is contained in:
parent
625ea6f24b
commit
1954105cc6
@ -259,7 +259,7 @@ def run_content_classification_inference(
|
|||||||
if prob < 0.25:
|
if prob < 0.25:
|
||||||
raw_score = 0.0
|
raw_score = 0.0
|
||||||
elif prob < 0.75:
|
elif prob < 0.75:
|
||||||
raw_score = (prob - 0.25) / 0.5
|
raw_score = min(1.0, (prob - 0.25) / 0.5)
|
||||||
else:
|
else:
|
||||||
raw_score = 1.0
|
raw_score = 1.0
|
||||||
return (
|
return (
|
||||||
@ -291,8 +291,8 @@ def run_content_classification_inference(
|
|||||||
_prob_to_score(p_temp) for p_temp in output_probabilities_with_temp
|
_prob_to_score(p_temp) for p_temp in output_probabilities_with_temp
|
||||||
]
|
]
|
||||||
|
|
||||||
output_classes = [1] * len(text_inputs)
|
# output_classes = [1] * len(text_inputs)
|
||||||
output_scores = [0.9] * len(text_inputs)
|
# output_scores = [0.9] * len(text_inputs)
|
||||||
|
|
||||||
return [
|
return [
|
||||||
(predicted_label, output_score)
|
(predicted_label, output_score)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user