Skip to content

Commit 50189f1

Browse files
Merge pull request #163 from ComplexData-MILA/merge-bijean-source-filter
Merge source filter and Bijean experiment percentile fix
2 parents 6e548f4 + 748ab8d commit 50189f1

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

app/api/endpoints/analysis_endpoints.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,11 @@ async def vary_assert(
268268
"""Get average reliability score for claims by language."""
269269
try:
270270
analysis = await analysis_orchestrator.vary_analysis_assertiveness(analysis_id=analysis_id)
271-
return AnalysisRead.model_validate(analysis)
271+
raw_score = analysis.confidence_score
272+
percentile = (get_percentile(raw_score)) / 100.0
273+
analysis = AnalysisRead.model_validate(analysis)
274+
analysis.confidence_percentile = percentile
275+
return analysis
272276
except Exception as e:
273277
raise HTTPException(
274278
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=f"Failed to get alter assertivity : {str(e)}"

0 commit comments

Comments
 (0)