File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -1813,7 +1813,11 @@ def get_score_fieldnames(cls) -> List[str]:
18131813
18141814 @property
18151815 def confidence (self ) -> float :
1816- return 0.75
1816+ return getattr (
1817+ self ,
1818+ f'{ self .predicted_class } { self .CLASS_FIELD_SUFFIX } ' ,
1819+ 0.0
1820+ ) if self .predicted_class else 1.0
18171821
18181822 @property
18191823 def uncertainty (self ) -> float :
Original file line number Diff line number Diff line change @@ -2359,15 +2359,19 @@ def get_final_combined_expert_category_euro(self) -> str:
23592359 if identification_task .status == IdentificationTask .Status .CONFLICT :
23602360 return "Conflict"
23612361
2362+ suffix = ""
2363+ if identification_task .result_source == IdentificationTask .ResultSource .AI :
2364+ suffix = "({})" .format (identification_task .result_source ).upper ()
2365+
23622366 res = "Other species"
23632367 if identification_task .taxon .is_relevant :
23642368 with translation .override ('en' ):
2365- res = "{} {}" .format (identification_task . confidence_label , identification_task . taxon . name )
2366-
2367- if identification_task . result_source == IdentificationTask . ResultSource . AI :
2368- res = res + " ({})" . format ( identification_task . result_source )
2369+ res = "{} {}" .format (
2370+ identification_task . confidence_label if identification_task . result_source != IdentificationTask . ResultSource . AI else "" ,
2371+ identification_task . taxon . name
2372+ )
23692373
2370- return res
2374+ return f" { res } { suffix } " . strip ()
23712375
23722376 # This is just a formatter of get_final_combined_expert_category_euro_struct. Takes the exact same output and makes it
23732377 # template friendly, also adds explicit ids for category and complex
You can’t perform that action at this time.
0 commit comments