Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions Jujutsu-Quants/app/adk/agents/sentiment_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,6 @@ def classify(self, text: str) -> str:
if neg > pos:
return "negative"
return "neutral"
def classify_with_confidence(self, text: str) -> Dict[str, Any]:
"""Classify text with confidence and reason."""
t = text.lower() if text else ""
pos_count = sum(1 for w in self.positive_words if w in t)
neg_count = sum(1 for w in self.negative_words if w in t)
label = self.classify(text)
confidence = min(1.0, (pos_count + neg_count) / 5.0) # capped at 1.0
reason = f"pos={pos_count}, neg={neg_count}"
return {
"label": label,
"confidence": confidence,
"reason": reason
}
def analyze(self, articles: List[Dict]) -> List[Dict]:
results: List[Dict] = []
for a in articles:
Expand Down