From dc801c07cf38b0c495686463e6ca6f871a64440e Mon Sep 17 00:00:00 2001 From: YurenHao0426 Date: Tue, 27 Jan 2026 09:57:37 -0600 Subject: Add collaborativeagents module and update gitignore - Add collaborativeagents subproject with adapters, agents, and evaluation modules - Update .gitignore to exclude large binary files (.whl, .tar), wandb logs, and results Co-Authored-By: Claude Opus 4.5 --- collaborativeagents/scripts/test_extractor.py | 46 +++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 collaborativeagents/scripts/test_extractor.py (limited to 'collaborativeagents/scripts/test_extractor.py') diff --git a/collaborativeagents/scripts/test_extractor.py b/collaborativeagents/scripts/test_extractor.py new file mode 100644 index 0000000..a2b4ac1 --- /dev/null +++ b/collaborativeagents/scripts/test_extractor.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 +"""Quick test for the preference extractor.""" + +import sys +sys.path.insert(0, "/projects/bfqt/users/yurenh2/ml-projects/personalization-user-model/src") + +from personalization.config.registry import get_preference_extractor + +print("="*60) +print("PREFERENCE EXTRACTOR TEST") +print("="*60) + +print("\nLoading extractor (qwen3_0_6b_sft)...") +extractor = get_preference_extractor("qwen3_0_6b_sft") +print("Extractor loaded successfully!") + +# Test extraction with various queries +test_queries = [ + "I prefer Python over Java for scripting tasks", + "Please use bullet points instead of numbered lists", + "Can you explain this in simpler terms? I'm a beginner.", + "I like concise answers, not long explanations", + "Always show code examples when explaining programming concepts", +] + +print("\n" + "="*60) +print("EXTRACTION TESTS") +print("="*60) + +for i, query in enumerate(test_queries, 1): + print(f"\n--- Test {i} ---") + print(f"Query: {query}") + result = extractor.extract_preferences(query) + print(f"Extracted: {result}") + + if result.get("preferences"): + for pref in result["preferences"]: + print(f" - condition: {pref.get('condition', 'N/A')}") + print(f" action: {pref.get('action', 'N/A')}") + print(f" confidence: {pref.get('confidence', 'N/A')}") + else: + print(" (No preferences extracted)") + +print("\n" + "="*60) +print("TEST COMPLETE") +print("="*60) -- cgit v1.2.3