Skip to content

Commit 50d6eb2

Browse files
authored
Merge pull request #11 from SUJALGOYALL/revert-8-weigh-the-cursed-mood
Revert "feat: add classify_with_confidence method to SentimentAgent"
2 parents 9b05cc9 + 34c4a7c commit 50d6eb2

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

Jujutsu-Quants/app/adk/agents/sentiment_agent.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff 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:

0 commit comments

Comments
 (0)