File tree Expand file tree Collapse file tree 1 file changed +0
-13
lines changed
Jujutsu-Quants/app/adk/agents Expand file tree Collapse file tree 1 file changed +0
-13
lines changed Original file line number Diff line number Diff line change @@ -40,19 +40,6 @@ def classify(self, text: str) -> str:
4040 if neg > pos :
4141 return "negative"
4242 return "neutral"
43- def classify_with_confidence (self , text : str ) -> Dict [str , Any ]:
44- """Classify text with confidence and reason."""
45- t = text .lower () if text else ""
46- pos_count = sum (1 for w in self .positive_words if w in t )
47- neg_count = sum (1 for w in self .negative_words if w in t )
48- label = self .classify (text )
49- confidence = min (1.0 , (pos_count + neg_count ) / 5.0 ) # capped at 1.0
50- reason = f"pos={ pos_count } , neg={ neg_count } "
51- return {
52- "label" : label ,
53- "confidence" : confidence ,
54- "reason" : reason
55- }
5643 def analyze (self , articles : List [Dict ]) -> List [Dict ]:
5744 results : List [Dict ] = []
5845 for a in articles :
You can’t perform that action at this time.
0 commit comments