generated from coulomb/repo-seed
confidence labels
This commit is contained in:
@@ -4,6 +4,14 @@ from dataclasses import dataclass, field
|
||||
from typing import Any
|
||||
|
||||
|
||||
def confidence_label(confidence: float) -> str:
|
||||
if confidence >= 0.8:
|
||||
return "high"
|
||||
if confidence >= 0.5:
|
||||
return "medium"
|
||||
return "low"
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Repository:
|
||||
id: int
|
||||
@@ -107,6 +115,7 @@ class CandidateFeature:
|
||||
confidence: float
|
||||
status: str
|
||||
source_refs: list[SourceReference]
|
||||
confidence_label: str = ""
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -119,6 +128,7 @@ class CandidateCapability:
|
||||
confidence: float
|
||||
status: str
|
||||
source_refs: list[SourceReference]
|
||||
confidence_label: str = ""
|
||||
features: list[CandidateFeature] = field(default_factory=list)
|
||||
evidence: list[CandidateEvidence] = field(default_factory=list)
|
||||
|
||||
@@ -131,6 +141,7 @@ class CandidateAbility:
|
||||
confidence: float
|
||||
status: str
|
||||
source_refs: list[SourceReference]
|
||||
confidence_label: str = ""
|
||||
capabilities: list[CandidateCapability] = field(default_factory=list)
|
||||
|
||||
|
||||
@@ -157,6 +168,7 @@ class Feature:
|
||||
type: str
|
||||
location: str
|
||||
confidence: float
|
||||
confidence_label: str = ""
|
||||
source_refs: list[SourceReference] = field(default_factory=list)
|
||||
|
||||
|
||||
@@ -168,6 +180,7 @@ class Capability:
|
||||
inputs: list[str]
|
||||
outputs: list[str]
|
||||
confidence: float
|
||||
confidence_label: str = ""
|
||||
features: list[Feature] = field(default_factory=list)
|
||||
evidence: list[Evidence] = field(default_factory=list)
|
||||
|
||||
@@ -178,6 +191,7 @@ class Ability:
|
||||
name: str
|
||||
description: str
|
||||
confidence: float
|
||||
confidence_label: str = ""
|
||||
capabilities: list[Capability] = field(default_factory=list)
|
||||
|
||||
|
||||
@@ -194,6 +208,7 @@ class SearchResult:
|
||||
match_type: str
|
||||
match_name: str
|
||||
confidence: float
|
||||
confidence_label: str = ""
|
||||
match_description: str = ""
|
||||
matched_field: str = ""
|
||||
ability_id: int | None = None
|
||||
@@ -212,6 +227,7 @@ class AbilitySummary:
|
||||
name: str
|
||||
description: str
|
||||
confidence: float
|
||||
confidence_label: str = ""
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -224,3 +240,4 @@ class CapabilitySummary:
|
||||
name: str
|
||||
description: str
|
||||
confidence: float
|
||||
confidence_label: str = ""
|
||||
|
||||
Reference in New Issue
Block a user