Rename to AI Papers Intelligence Classifier and add full intelligence spectrum
Browse files- Renamed project from AGI/ASI Papers Analysis to AI Papers Intelligence Classifier
- Added ANI (Artificial Narrow Intelligence) classification level with keywords
- Added Other AI classification level for general AI topics
- Added ML (Machine Learning) classification level with keywords
- Added DS (Data Science) classification level with keywords
- Updated classification hierarchy: ASI → AGI → ACI → ANI → Other AI → ML → DS → Not Related
- Updated classifier.py with new keyword categories and scoring weights
- Updated ranker.py with new classification hierarchy and impact scores
- Enhanced UI with new classification columns and color coding
- Updated visualizations to include all 8 classification levels
- Updated all tests to match new classification system
- Updated documentation (CONCEPT.md, README.md) with new name and classification system
- Renamed classifier class from AGIASIClassifier to AIPapersIntelligenceClassifier
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- CONCEPT.md +101 -47
- README.md +44 -18
- app.py +62 -42
- classifier.py +267 -61
- ranker.py +24 -14
- tests/test_classifier.py +44 -22
- tests/test_ranker.py +12 -3
|
@@ -1,37 +1,57 @@
|
|
| 1 |
-
#
|
| 2 |
|
| 3 |
-
This guide explains the concepts, methodology, and technical architecture behind the
|
| 4 |
|
| 5 |
## 🎓 Educational Purpose
|
| 6 |
|
| 7 |
-
This tool demonstrates how to build an AI-powered research analysis system for tracking AGI (Artificial General Intelligence), ASI (Artificial Super Intelligence),
|
| 8 |
|
| 9 |
## Core Concepts
|
| 10 |
|
| 11 |
-
### 1.
|
| 12 |
|
| 13 |
-
|
| 14 |
-
- AI systems with human-level cognitive abilities across diverse domains
|
| 15 |
-
- Capable of learning, reasoning, and adapting to new situations
|
| 16 |
-
- Key characteristics: transfer learning, few-shot learning, reasoning systems
|
| 17 |
|
| 18 |
**ASI (Artificial Super Intelligence)**
|
| 19 |
- AI systems surpassing human intelligence in all domains
|
| 20 |
- Associated with existential risk, alignment problems, and safety concerns
|
| 21 |
- Key topics: AI safety, alignment, superintelligence, singularity
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
**ACI (Artificial Collective Intelligence)**
|
| 24 |
- AI systems that demonstrate emergent intelligence through multi-agent collaboration
|
| 25 |
- Focus on swarm intelligence, human-AI collaboration, and distributed cognition
|
| 26 |
- Key topics: multi-agent systems, swarm intelligence, collaborative AI
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
### 2. Research Analysis Methodology
|
| 29 |
|
| 30 |
The tool uses a hybrid approach combining:
|
| 31 |
|
| 32 |
**Keyword-Based Analysis**
|
| 33 |
- Fast pattern matching against curated keyword lists
|
| 34 |
-
- Identifies papers mentioning
|
| 35 |
- Provides baseline classification
|
| 36 |
|
| 37 |
**Semantic Analysis (Optional)**
|
|
@@ -39,7 +59,7 @@ The tool uses a hybrid approach combining:
|
|
| 39 |
- Captures nuance and context beyond keywords
|
| 40 |
- Enhances classification accuracy
|
| 41 |
|
| 42 |
-
**Reasoning-Based Classification
|
| 43 |
- Uses DeepSeek-R1 with Chain of Thought reasoning
|
| 44 |
- Provides detailed analysis and confidence scores
|
| 45 |
- More accurate classification of complex papers
|
|
@@ -51,15 +71,18 @@ The tool uses a hybrid approach combining:
|
|
| 51 |
|
| 52 |
### 3. Classification System
|
| 53 |
|
| 54 |
-
Papers are classified into
|
| 55 |
|
| 56 |
-
|
|
| 57 |
-
|
|
| 58 |
-
|
|
| 59 |
-
|
|
| 60 |
-
|
|
| 61 |
-
|
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
### 4. Ranking Algorithm
|
| 65 |
|
|
@@ -67,18 +90,20 @@ The ranking system uses weighted scoring:
|
|
| 67 |
|
| 68 |
**Relevance Score (50%)**
|
| 69 |
- Based on keyword matches and semantic analysis
|
| 70 |
-
-
|
| 71 |
-
-
|
|
|
|
|
|
|
| 72 |
- Semantic analysis adds up to 20 points
|
| 73 |
|
| 74 |
**Novelty Score (30%)**
|
| 75 |
- Measures keyword diversity and uniqueness
|
| 76 |
-
- Bonus for papers with
|
| 77 |
- Encourages innovative research
|
| 78 |
|
| 79 |
**Impact Score (20%)**
|
| 80 |
- Based on classification level
|
| 81 |
-
-
|
| 82 |
- Reflects potential significance
|
| 83 |
|
| 84 |
**Composite Score**
|
|
@@ -105,7 +130,7 @@ Composite = (Relevance × 0.5) + (Novelty × 0.3) + (Impact × 0.2)
|
|
| 105 |
│
|
| 106 |
▼
|
| 107 |
┌─────────────────────────────────────────────────────────┐
|
| 108 |
-
│
|
| 109 |
│ (Keyword Analysis + Semantic Analysis + Reasoning) │
|
| 110 |
└────────────────────────┬────────────────────────────────┘
|
| 111 |
│
|
|
@@ -134,14 +159,14 @@ Composite = (Relevance × 0.5) + (Novelty × 0.3) + (Impact × 0.2)
|
|
| 134 |
|
| 135 |
The tool supports multiple analysis models:
|
| 136 |
|
| 137 |
-
|
|
| 138 |
-
|
|
| 139 |
-
|
|
| 140 |
-
|
|
| 141 |
-
|
|
| 142 |
-
|
|
| 143 |
-
|
|
| 144 |
-
|
|
| 145 |
|
| 146 |
### Classification Modes
|
| 147 |
|
|
@@ -164,13 +189,6 @@ The tool supports three classification modes:
|
|
| 164 |
|
| 165 |
## Keyword Strategy
|
| 166 |
|
| 167 |
-
### AGI Keywords
|
| 168 |
-
Focus on general intelligence capabilities:
|
| 169 |
-
- "general intelligence", "AGI", "human-level AI"
|
| 170 |
-
- "transfer learning", "few-shot learning", "meta-learning"
|
| 171 |
-
- "reasoning systems", "neuro-symbolic integration"
|
| 172 |
-
- "autonomous agents", "self-improving AI"
|
| 173 |
-
|
| 174 |
### ASI Keywords
|
| 175 |
Focus on superintelligence and safety:
|
| 176 |
- "superintelligence", "ASI", "existential risk"
|
|
@@ -178,6 +196,13 @@ Focus on superintelligence and safety:
|
|
| 178 |
- "recursive self-improvement", "singularity"
|
| 179 |
- "AI control problem", "beneficial AI"
|
| 180 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
### ACI Keywords
|
| 182 |
Focus on collective intelligence:
|
| 183 |
- "multi-agent systems", "swarm intelligence"
|
|
@@ -185,6 +210,34 @@ Focus on collective intelligence:
|
|
| 185 |
- "distributed cognition", "emergent behavior"
|
| 186 |
- "human-AI collaboration", "agent coordination"
|
| 187 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
### Related Keywords
|
| 189 |
Contextual AI research terms:
|
| 190 |
- "deep learning", "neural networks", "LLM"
|
|
@@ -195,7 +248,7 @@ Contextual AI research terms:
|
|
| 195 |
|
| 196 |
### Classification Distribution (Pie Chart)
|
| 197 |
- Shows proportion of papers in each classification level
|
| 198 |
-
- Helps understand overall
|
| 199 |
|
| 200 |
### Ranking Scores (Bar Chart)
|
| 201 |
- Compares final rank vs combined relevance scores
|
|
@@ -207,19 +260,19 @@ Contextual AI research terms:
|
|
| 207 |
- Helps identify novel, high-relevance research
|
| 208 |
|
| 209 |
### Trend Analysis (Line Chart)
|
| 210 |
-
- Tracks
|
| 211 |
- Shows relevance rate changes across weeks
|
| 212 |
-
- Identifies periods of high
|
| 213 |
|
| 214 |
## Performance Considerations
|
| 215 |
|
| 216 |
### Speed vs Accuracy Trade-off
|
| 217 |
|
| 218 |
-
|
|
| 219 |
-
|
|
| 220 |
-
|
|
| 221 |
-
|
|
| 222 |
-
|
|
| 223 |
|
| 224 |
### Caching Strategy
|
| 225 |
- Year-level data cached for 1 hour
|
|
@@ -257,7 +310,7 @@ Potential improvements to consider:
|
|
| 257 |
1. **Expanded Data Sources**: Include arXiv, conference proceedings
|
| 258 |
2. **Custom Keyword Lists**: Allow users to define custom keywords
|
| 259 |
3. **Citation Analysis**: Incorporate citation counts and impact metrics
|
| 260 |
-
4. **Author Tracking**: Track researchers working on
|
| 261 |
5. **Topic Modeling**: Use LDA or similar for topic discovery
|
| 262 |
6. **Cross-Reference**: Link related papers across weeks
|
| 263 |
7. **Alert System**: Notify users of high-relevance papers
|
|
@@ -274,6 +327,7 @@ This project demonstrates:
|
|
| 274 |
5. **Gradio Interfaces**: Building web-based ML tools
|
| 275 |
6. **Research Analysis**: Techniques for academic paper analysis
|
| 276 |
7. **Reasoning Systems**: Chain of thought classification
|
|
|
|
| 277 |
|
| 278 |
## References
|
| 279 |
|
|
|
|
| 1 |
+
# AI Papers Intelligence Classifier - Concept Guide
|
| 2 |
|
| 3 |
+
This guide explains the concepts, methodology, and technical architecture behind the AI Papers Intelligence Classifier tool.
|
| 4 |
|
| 5 |
## 🎓 Educational Purpose
|
| 6 |
|
| 7 |
+
This tool demonstrates how to build an AI-powered research analysis system for tracking AI research across the entire intelligence spectrum: ANI (Artificial Narrow Intelligence), AGI (Artificial General Intelligence), ASI (Artificial Super Intelligence), ACI (Artificial Collective Intelligence), ML (Machine Learning), and DS (Data Science).
|
| 8 |
|
| 9 |
## Core Concepts
|
| 10 |
|
| 11 |
+
### 1. Intelligence Spectrum
|
| 12 |
|
| 13 |
+
The tool classifies AI research across a comprehensive intelligence spectrum:
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
**ASI (Artificial Super Intelligence)**
|
| 16 |
- AI systems surpassing human intelligence in all domains
|
| 17 |
- Associated with existential risk, alignment problems, and safety concerns
|
| 18 |
- Key topics: AI safety, alignment, superintelligence, singularity
|
| 19 |
|
| 20 |
+
**AGI (Artificial General Intelligence)**
|
| 21 |
+
- AI systems with human-level cognitive abilities across diverse domains
|
| 22 |
+
- Capable of learning, reasoning, and adapting to new situations
|
| 23 |
+
- Key characteristics: transfer learning, few-shot learning, reasoning systems
|
| 24 |
+
|
| 25 |
**ACI (Artificial Collective Intelligence)**
|
| 26 |
- AI systems that demonstrate emergent intelligence through multi-agent collaboration
|
| 27 |
- Focus on swarm intelligence, human-AI collaboration, and distributed cognition
|
| 28 |
- Key topics: multi-agent systems, swarm intelligence, collaborative AI
|
| 29 |
|
| 30 |
+
**ANI (Artificial Narrow Intelligence)**
|
| 31 |
+
- Specialized AI systems designed for specific tasks or domains
|
| 32 |
+
- Focus on task-specific optimization and domain expertise
|
| 33 |
+
- Key topics: expert systems, specialized neural networks, vertical AI
|
| 34 |
+
|
| 35 |
+
**Other AI**
|
| 36 |
+
- General AI topics that don't fit specific intelligence categories
|
| 37 |
+
- Broad AI research, applications, and systems
|
| 38 |
+
- Key topics: computer vision, NLP, robotics, intelligent systems
|
| 39 |
+
|
| 40 |
+
**ML (Machine Learning)**
|
| 41 |
+
- Focus on learning algorithms and statistical methods
|
| 42 |
+
- Key topics: neural networks, deep learning, supervised/unsupervised learning
|
| 43 |
+
|
| 44 |
+
**DS (Data Science)**
|
| 45 |
+
- Focus on data analysis, visualization, and methodologies
|
| 46 |
+
- Key topics: data mining, statistical analysis, data engineering
|
| 47 |
+
|
| 48 |
### 2. Research Analysis Methodology
|
| 49 |
|
| 50 |
The tool uses a hybrid approach combining:
|
| 51 |
|
| 52 |
**Keyword-Based Analysis**
|
| 53 |
- Fast pattern matching against curated keyword lists
|
| 54 |
+
- Identifies papers mentioning AI/ML/DS concepts
|
| 55 |
- Provides baseline classification
|
| 56 |
|
| 57 |
**Semantic Analysis (Optional)**
|
|
|
|
| 59 |
- Captures nuance and context beyond keywords
|
| 60 |
- Enhances classification accuracy
|
| 61 |
|
| 62 |
+
**Reasoning-Based Classification**
|
| 63 |
- Uses DeepSeek-R1 with Chain of Thought reasoning
|
| 64 |
- Provides detailed analysis and confidence scores
|
| 65 |
- More accurate classification of complex papers
|
|
|
|
| 71 |
|
| 72 |
### 3. Classification System
|
| 73 |
|
| 74 |
+
Papers are classified into eight levels across the intelligence spectrum:
|
| 75 |
|
| 76 |
+
| Level | Criteria | Description |
|
| 77 |
+
|-------|----------|-------------|
|
| 78 |
+
| ASI | 3+ ASI keywords or highest-level reasoning | Direct focus on superintelligence and existential risk |
|
| 79 |
+
| AGI | 3+ AGI keywords or high-level reasoning | Direct focus on general intelligence capabilities |
|
| 80 |
+
| ACI | 3+ ACI keywords or collective intelligence focus | Multi-agent systems and swarm intelligence |
|
| 81 |
+
| ANI | 3+ ANI keywords or specialized AI focus | Task-specific AI and domain expertise |
|
| 82 |
+
| Other AI | 3+ Other AI keywords or general AI focus | Broad AI topics and applications |
|
| 83 |
+
| ML | 3+ ML keywords or machine learning focus | Learning algorithms and statistical methods |
|
| 84 |
+
| DS | 3+ DS keywords or data science focus | Data analysis and methodologies |
|
| 85 |
+
| Not Related | No significant matches | No clear AI/ML/DS connection |
|
| 86 |
|
| 87 |
### 4. Ranking Algorithm
|
| 88 |
|
|
|
|
| 90 |
|
| 91 |
**Relevance Score (50%)**
|
| 92 |
- Based on keyword matches and semantic analysis
|
| 93 |
+
- ASI and AGI keywords weighted higher (3.0x)
|
| 94 |
+
- ACI and ANI keywords weighted medium (2.0-2.5x)
|
| 95 |
+
- Other AI and ML keywords weighted lower (1.5x)
|
| 96 |
+
- DS and related keywords weighted lowest (1.0x)
|
| 97 |
- Semantic analysis adds up to 20 points
|
| 98 |
|
| 99 |
**Novelty Score (30%)**
|
| 100 |
- Measures keyword diversity and uniqueness
|
| 101 |
+
- Bonus for papers with multiple intelligence level keywords
|
| 102 |
- Encourages innovative research
|
| 103 |
|
| 104 |
**Impact Score (20%)**
|
| 105 |
- Based on classification level
|
| 106 |
+
- Higher levels (ASI, AGI) have higher base impact
|
| 107 |
- Reflects potential significance
|
| 108 |
|
| 109 |
**Composite Score**
|
|
|
|
| 130 |
│
|
| 131 |
▼
|
| 132 |
┌─────────────────────────────────────────────────────────┐
|
| 133 |
+
│ AI Papers Intelligence Classifier │
|
| 134 |
│ (Keyword Analysis + Semantic Analysis + Reasoning) │
|
| 135 |
└────────────────────────┬────────────────────────────────┘
|
| 136 |
│
|
|
|
|
| 159 |
|
| 160 |
The tool supports multiple analysis models:
|
| 161 |
|
| 162 |
+
| Model | Use Case | Pros | Cons |
|
| 163 |
+
|-------|----------|------|------|
|
| 164 |
+
| Keyword | Quick screening | Fast, free, no setup | Limited understanding |
|
| 165 |
+
| OpenAI GPT | Deep analysis | Best semantic understanding | Paid, requires API key |
|
| 166 |
+
| Anthropic Claude | Complex papers | Excellent reasoning | Paid, requires API key |
|
| 167 |
+
| Ollama | Privacy-focused | Free, local, private | Slower, requires setup |
|
| 168 |
+
| Hugging Face | Budget-friendly | Free tier, good quality | Rate limits, API key |
|
| 169 |
+
| DeepSeek-R1 | Reasoning classification | Chain of thought, accurate | Medium speed, requires HF |
|
| 170 |
|
| 171 |
### Classification Modes
|
| 172 |
|
|
|
|
| 189 |
|
| 190 |
## Keyword Strategy
|
| 191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
### ASI Keywords
|
| 193 |
Focus on superintelligence and safety:
|
| 194 |
- "superintelligence", "ASI", "existential risk"
|
|
|
|
| 196 |
- "recursive self-improvement", "singularity"
|
| 197 |
- "AI control problem", "beneficial AI"
|
| 198 |
|
| 199 |
+
### AGI Keywords
|
| 200 |
+
Focus on general intelligence capabilities:
|
| 201 |
+
- "general intelligence", "AGI", "human-level AI"
|
| 202 |
+
- "transfer learning", "few-shot learning", "meta-learning"
|
| 203 |
+
- "reasoning systems", "neuro-symbolic integration"
|
| 204 |
+
- "autonomous agents", "self-improving AI"
|
| 205 |
+
|
| 206 |
### ACI Keywords
|
| 207 |
Focus on collective intelligence:
|
| 208 |
- "multi-agent systems", "swarm intelligence"
|
|
|
|
| 210 |
- "distributed cognition", "emergent behavior"
|
| 211 |
- "human-AI collaboration", "agent coordination"
|
| 212 |
|
| 213 |
+
### ANI Keywords
|
| 214 |
+
Focus on narrow/specialized AI:
|
| 215 |
+
- "narrow AI", "specialized AI", "task-specific AI"
|
| 216 |
+
- "domain-specific systems", "expert systems"
|
| 217 |
+
- "single-purpose AI", "focused AI applications"
|
| 218 |
+
- "specialized neural networks", "task optimization"
|
| 219 |
+
|
| 220 |
+
### Other AI Keywords
|
| 221 |
+
Focus on general AI topics:
|
| 222 |
+
- "artificial intelligence", "AI research"
|
| 223 |
+
- "AI applications", "AI systems"
|
| 224 |
+
- "computer vision", "NLP", "speech recognition"
|
| 225 |
+
- "robotics", "autonomous systems"
|
| 226 |
+
|
| 227 |
+
### ML Keywords
|
| 228 |
+
Focus on machine learning:
|
| 229 |
+
- "machine learning", "deep learning"
|
| 230 |
+
- "neural networks", "CNN", "RNN", "Transformer"
|
| 231 |
+
- "supervised learning", "unsupervised learning"
|
| 232 |
+
- "reinforcement learning", "feature engineering"
|
| 233 |
+
|
| 234 |
+
### DS Keywords
|
| 235 |
+
Focus on data science:
|
| 236 |
+
- "data science", "data analysis"
|
| 237 |
+
- "data mining", "big data"
|
| 238 |
+
- "statistical analysis", "data visualization"
|
| 239 |
+
- "data engineering", "data pipelines"
|
| 240 |
+
|
| 241 |
### Related Keywords
|
| 242 |
Contextual AI research terms:
|
| 243 |
- "deep learning", "neural networks", "LLM"
|
|
|
|
| 248 |
|
| 249 |
### Classification Distribution (Pie Chart)
|
| 250 |
- Shows proportion of papers in each classification level
|
| 251 |
+
- Helps understand overall AI/ML/DS relevance
|
| 252 |
|
| 253 |
### Ranking Scores (Bar Chart)
|
| 254 |
- Compares final rank vs combined relevance scores
|
|
|
|
| 260 |
- Helps identify novel, high-relevance research
|
| 261 |
|
| 262 |
### Trend Analysis (Line Chart)
|
| 263 |
+
- Tracks AI research patterns over time
|
| 264 |
- Shows relevance rate changes across weeks
|
| 265 |
+
- Identifies periods of high AI activity
|
| 266 |
|
| 267 |
## Performance Considerations
|
| 268 |
|
| 269 |
### Speed vs Accuracy Trade-off
|
| 270 |
|
| 271 |
+
| Mode | Speed | Accuracy | Best For |
|
| 272 |
+
|------|-------|----------|----------|
|
| 273 |
+
| Keyword Only | ⚡⚡⚡ | ⭐⭐ | High-volume screening |
|
| 274 |
+
| Reasoning Only | ⚡ | ⭐⭐⭐⭐⭐ | Deep analysis |
|
| 275 |
+
| Hybrid | ⚡⚡ | ⭐⭐⭐⭐ | Balanced approach |
|
| 276 |
|
| 277 |
### Caching Strategy
|
| 278 |
- Year-level data cached for 1 hour
|
|
|
|
| 310 |
1. **Expanded Data Sources**: Include arXiv, conference proceedings
|
| 311 |
2. **Custom Keyword Lists**: Allow users to define custom keywords
|
| 312 |
3. **Citation Analysis**: Incorporate citation counts and impact metrics
|
| 313 |
+
4. **Author Tracking**: Track researchers working on AI topics
|
| 314 |
5. **Topic Modeling**: Use LDA or similar for topic discovery
|
| 315 |
6. **Cross-Reference**: Link related papers across weeks
|
| 316 |
7. **Alert System**: Notify users of high-relevance papers
|
|
|
|
| 327 |
5. **Gradio Interfaces**: Building web-based ML tools
|
| 328 |
6. **Research Analysis**: Techniques for academic paper analysis
|
| 329 |
7. **Reasoning Systems**: Chain of thought classification
|
| 330 |
+
8. **Intelligence Spectrum**: Understanding AI classification across levels
|
| 331 |
|
| 332 |
## References
|
| 333 |
|
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
emoji: 🧠
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: red
|
|
@@ -11,13 +11,13 @@ pinned: false
|
|
| 11 |
license: mit
|
| 12 |
---
|
| 13 |
|
| 14 |
-
# 🧠
|
| 15 |
|
| 16 |
-
Analyze AI papers from [AI-Papers-of-the-Week](https://github.com/dair-ai/AI-Papers-of-the-Week)
|
| 17 |
|
| 18 |
## 🎯 Purpose
|
| 19 |
|
| 20 |
-
This tool helps researchers, students, and AI
|
| 21 |
|
| 22 |
## 🚀 Features
|
| 23 |
|
|
@@ -39,21 +39,23 @@ This tool helps researchers, students, and AI safety enthusiasts track and analy
|
|
| 39 |
- Relevance vs novelty scatter plot
|
| 40 |
|
| 41 |
### **Trend Analysis**
|
| 42 |
-
- Track
|
| 43 |
- Visualize relevance rates across weeks
|
| 44 |
-
- Identify periods of high
|
| 45 |
- Compare research patterns across years
|
| 46 |
|
| 47 |
### **Classification System**
|
| 48 |
- **ASI**: Direct focus on superintelligence and existential risk
|
| 49 |
- **AGI**: Direct focus on general intelligence capabilities
|
| 50 |
- **ACI**: Multi-agent systems and collective intelligence
|
| 51 |
-
- **
|
| 52 |
-
- **
|
|
|
|
|
|
|
| 53 |
|
| 54 |
### **Ranking Methodology**
|
| 55 |
Papers are ranked using a composite score:
|
| 56 |
-
- **Relevance** (50%):
|
| 57 |
- **Novelty** (30%): Keyword diversity and innovation potential
|
| 58 |
- **Impact** (20%): Classification level and potential impact
|
| 59 |
|
|
@@ -80,13 +82,7 @@ Papers are ranked using a composite score:
|
|
| 80 |
- **[How It Works](HOW_IT_WORKS.md)** - Detailed technical explanation
|
| 81 |
- **[Feature Ideas](FEATURES.md)** - Future enhancements and roadmap
|
| 82 |
|
| 83 |
-
## 🏷️
|
| 84 |
-
|
| 85 |
-
### AGI Keywords
|
| 86 |
-
- General intelligence, AGI, human-level AI
|
| 87 |
-
- Transfer learning, few-shot learning, meta-learning
|
| 88 |
-
- Reasoning systems, commonsense reasoning
|
| 89 |
-
- Neural-symbolic integration, multi-modal learning
|
| 90 |
|
| 91 |
### ASI Keywords
|
| 92 |
- Superintelligence, ASI, existential risk
|
|
@@ -94,12 +90,42 @@ Papers are ranked using a composite score:
|
|
| 94 |
- Recursive self-improvement, intelligence explosion
|
| 95 |
- Singularity, transformative AI
|
| 96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
### ACI Keywords
|
| 98 |
- Multi-agent systems, swarm intelligence
|
| 99 |
- Collective intelligence, collaborative AI
|
| 100 |
- Distributed cognition, emergent behavior
|
| 101 |
- Human-AI collaboration, agent coordination
|
| 102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
## 🚀 Quick Start
|
| 104 |
|
| 105 |
### Local Installation
|
|
@@ -174,12 +200,12 @@ See [Deployment Guide](DEPLOYMENT.md) for AWS, GCP, Azure, and Heroku instructio
|
|
| 174 |
## 🎓 Educational Purpose
|
| 175 |
|
| 176 |
This project is created for **educational purposes only** to demonstrate:
|
| 177 |
-
-
|
| 178 |
- Natural language processing for paper classification
|
| 179 |
- Data visualization for research trends
|
| 180 |
- Modern web application development with Gradio
|
| 181 |
|
| 182 |
-
The tool helps researchers and students understand the landscape of
|
| 183 |
|
| 184 |
## 📚 Data Source
|
| 185 |
|
|
|
|
| 1 |
---
|
| 2 |
+
title: AI Papers Intelligence Classifier
|
| 3 |
emoji: 🧠
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: red
|
|
|
|
| 11 |
license: mit
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# 🧠 AI Papers Intelligence Classifier
|
| 15 |
|
| 16 |
+
Analyze AI papers from [AI-Papers-of-the-Week](https://github.com/dair-ai/AI-Papers-of-the-Week) across the intelligence spectrum: ANI (Artificial Narrow Intelligence), AGI (Artificial General Intelligence), ASI (Artificial Super Intelligence), ACI (Artificial Collective Intelligence), ML (Machine Learning), and DS (Data Science) with ranking, trend analysis, and comparison tools.
|
| 17 |
|
| 18 |
## 🎯 Purpose
|
| 19 |
|
| 20 |
+
This tool helps researchers, students, and AI enthusiasts track and analyze AI research developments across the entire intelligence spectrum by automatically classifying and ranking AI papers from the weekly AI-Papers-of-the-Week newsletter.
|
| 21 |
|
| 22 |
## 🚀 Features
|
| 23 |
|
|
|
|
| 39 |
- Relevance vs novelty scatter plot
|
| 40 |
|
| 41 |
### **Trend Analysis**
|
| 42 |
+
- Track AI research trends across the intelligence spectrum
|
| 43 |
- Visualize relevance rates across weeks
|
| 44 |
+
- Identify periods of high activity in different AI domains
|
| 45 |
- Compare research patterns across years
|
| 46 |
|
| 47 |
### **Classification System**
|
| 48 |
- **ASI**: Direct focus on superintelligence and existential risk
|
| 49 |
- **AGI**: Direct focus on general intelligence capabilities
|
| 50 |
- **ACI**: Multi-agent systems and collective intelligence
|
| 51 |
+
- **ANI**: Artificial Narrow Intelligence and specialized AI systems
|
| 52 |
+
- **Other AI**: General AI topics not fitting specific categories
|
| 53 |
+
- **ML**: Machine Learning algorithms and techniques
|
| 54 |
+
- **DS**: Data Science methodologies and applications
|
| 55 |
|
| 56 |
### **Ranking Methodology**
|
| 57 |
Papers are ranked using a composite score:
|
| 58 |
+
- **Relevance** (50%): Keyword density and semantic analysis across all intelligence levels
|
| 59 |
- **Novelty** (30%): Keyword diversity and innovation potential
|
| 60 |
- **Impact** (20%): Classification level and potential impact
|
| 61 |
|
|
|
|
| 82 |
- **[How It Works](HOW_IT_WORKS.md)** - Detailed technical explanation
|
| 83 |
- **[Feature Ideas](FEATURES.md)** - Future enhancements and roadmap
|
| 84 |
|
| 85 |
+
## 🏷️ Intelligence Level Keywords
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
### ASI Keywords
|
| 88 |
- Superintelligence, ASI, existential risk
|
|
|
|
| 90 |
- Recursive self-improvement, intelligence explosion
|
| 91 |
- Singularity, transformative AI
|
| 92 |
|
| 93 |
+
### AGI Keywords
|
| 94 |
+
- General intelligence, AGI, human-level AI
|
| 95 |
+
- Transfer learning, few-shot learning, meta-learning
|
| 96 |
+
- Reasoning systems, commonsense reasoning
|
| 97 |
+
- Neural-symbolic integration, multi-modal learning
|
| 98 |
+
|
| 99 |
### ACI Keywords
|
| 100 |
- Multi-agent systems, swarm intelligence
|
| 101 |
- Collective intelligence, collaborative AI
|
| 102 |
- Distributed cognition, emergent behavior
|
| 103 |
- Human-AI collaboration, agent coordination
|
| 104 |
|
| 105 |
+
### ANI Keywords
|
| 106 |
+
- Narrow AI, specialized AI, task-specific AI
|
| 107 |
+
- Domain-specific systems, expert systems
|
| 108 |
+
- Single-purpose AI, focused AI applications
|
| 109 |
+
- Specialized neural networks, task optimization
|
| 110 |
+
|
| 111 |
+
### Other AI Keywords
|
| 112 |
+
- Artificial intelligence, AI research
|
| 113 |
+
- AI applications, AI systems
|
| 114 |
+
- Computer vision, NLP, speech recognition
|
| 115 |
+
- Robotics, autonomous systems
|
| 116 |
+
|
| 117 |
+
### ML Keywords
|
| 118 |
+
- Machine learning, deep learning
|
| 119 |
+
- Neural networks, CNN, RNN, Transformer
|
| 120 |
+
- Supervised learning, unsupervised learning
|
| 121 |
+
- Reinforcement learning, feature engineering
|
| 122 |
+
|
| 123 |
+
### DS Keywords
|
| 124 |
+
- Data science, data analysis
|
| 125 |
+
- Data mining, big data
|
| 126 |
+
- Statistical analysis, data visualization
|
| 127 |
+
- Data engineering, data pipelines
|
| 128 |
+
|
| 129 |
## 🚀 Quick Start
|
| 130 |
|
| 131 |
### Local Installation
|
|
|
|
| 200 |
## 🎓 Educational Purpose
|
| 201 |
|
| 202 |
This project is created for **educational purposes only** to demonstrate:
|
| 203 |
+
- AI research tracking and analysis across the intelligence spectrum
|
| 204 |
- Natural language processing for paper classification
|
| 205 |
- Data visualization for research trends
|
| 206 |
- Modern web application development with Gradio
|
| 207 |
|
| 208 |
+
The tool helps researchers and students understand the landscape of AI research and track developments across all intelligence levels from narrow AI to superintelligence.
|
| 209 |
|
| 210 |
## 📚 Data Source
|
| 211 |
|
|
@@ -1,6 +1,6 @@
|
|
| 1 |
"""
|
| 2 |
-
|
| 3 |
-
Analyzes AI papers from AI-Papers-of-the-Week
|
| 4 |
"""
|
| 5 |
|
| 6 |
import gradio as gr
|
|
@@ -10,7 +10,7 @@ import plotly.express as px
|
|
| 10 |
from datetime import datetime
|
| 11 |
|
| 12 |
from data_fetcher import AIPapersFetcher
|
| 13 |
-
from classifier import
|
| 14 |
from ranker import PaperRanker
|
| 15 |
from model_manager import ModelManager
|
| 16 |
from advanced_analyzer import AdvancedAnalyzer
|
|
@@ -20,7 +20,7 @@ from reasoning_classifier import ReasoningClassifier
|
|
| 20 |
# Initialize components
|
| 21 |
fetcher = AIPapersFetcher()
|
| 22 |
model_manager = ModelManager()
|
| 23 |
-
classifier =
|
| 24 |
reasoning_classifier = ReasoningClassifier()
|
| 25 |
ranker = PaperRanker()
|
| 26 |
advanced_analyzer = AdvancedAnalyzer()
|
|
@@ -29,7 +29,7 @@ advanced_analyzer = AdvancedAnalyzer()
|
|
| 29 |
def analyze_week(year: str, week: str, model_id: str = "keyword",
|
| 30 |
classification_mode: str = "keyword", use_semantic: bool = False) -> tuple:
|
| 31 |
"""
|
| 32 |
-
Analyze papers from a specific week
|
| 33 |
|
| 34 |
Args:
|
| 35 |
year: Year to analyze
|
|
@@ -147,10 +147,13 @@ def analyze_week(year: str, week: str, model_id: str = "keyword",
|
|
| 147 |
# Add color-coded classification badge
|
| 148 |
classification = paper['classification_result']['classification']
|
| 149 |
classification_colors = {
|
| 150 |
-
'AGI': '#00D4AA',
|
| 151 |
'ASI': '#7C3AED',
|
|
|
|
| 152 |
'ACI': '#F59E0B',
|
| 153 |
-
'
|
|
|
|
|
|
|
|
|
|
| 154 |
'Not Related': '#EF4444'
|
| 155 |
}
|
| 156 |
color = classification_colors.get(classification, '#64748B')
|
|
@@ -160,9 +163,13 @@ def analyze_week(year: str, week: str, model_id: str = "keyword",
|
|
| 160 |
'Rank': paper.get('rank_position', 0),
|
| 161 |
'Title': paper.get('title', 'Unknown'), # Full title
|
| 162 |
'Classification': classification_html,
|
| 163 |
-
'AGI Score': paper['classification_result']['agi_score'],
|
| 164 |
'ASI Score': paper['classification_result']['asi_score'],
|
|
|
|
| 165 |
'ACI Score': paper['classification_result']['aci_score'],
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
'Combined Score': paper['classification_result']['combined_score'],
|
| 167 |
'Final Rank': paper.get('final_rank', 0),
|
| 168 |
'Model': semantic_info,
|
|
@@ -190,7 +197,7 @@ def generate_weekly_summary(year: str, week: str, total_papers: int,
|
|
| 190 |
stats: dict, relevant_papers: list, model_id: str,
|
| 191 |
use_semantic: bool) -> str:
|
| 192 |
"""Generate summary text for weekly analysis"""
|
| 193 |
-
summary = f"# 🧠
|
| 194 |
summary += f"## 📊 Overview\n\n"
|
| 195 |
summary += f"- **Analysis Method**: {'Semantic AI (' + model_id + ')' if use_semantic else 'Keyword-Based'}\n"
|
| 196 |
summary += f"- **Total Papers Analyzed**: {total_papers}\n"
|
|
@@ -198,12 +205,15 @@ def generate_weekly_summary(year: str, week: str, total_papers: int,
|
|
| 198 |
summary += f"- **AGI Papers**: {stats['agi']}\n"
|
| 199 |
summary += f"- **ASI Papers**: {stats['asi']}\n"
|
| 200 |
summary += f"- **ACI Papers**: {stats['aci']}\n"
|
| 201 |
-
summary += f"- **
|
|
|
|
|
|
|
|
|
|
| 202 |
summary += f"- **Not Related**: {stats['not_related']}\n"
|
| 203 |
summary += f"- **Relevance Rate**: {stats['relevance_rate']}%\n\n"
|
| 204 |
|
| 205 |
if relevant_papers:
|
| 206 |
-
summary += f"## 🎯 Top
|
| 207 |
for i, paper in enumerate(relevant_papers[:5], 1):
|
| 208 |
title = paper.get('title', 'Unknown')
|
| 209 |
classification = paper['classification_result']['classification']
|
|
@@ -222,10 +232,13 @@ def generate_statistics_text(stats: dict) -> str:
|
|
| 222 |
"""Generate statistics text"""
|
| 223 |
text = "## 📈 Classification Statistics\n\n"
|
| 224 |
text += f"- **Total Papers**: {stats['total']}\n"
|
| 225 |
-
text += f"- **AGI**: {stats['agi']} ({stats['agi']/stats['total']*100:.1f}%)\n"
|
| 226 |
text += f"- **ASI**: {stats['asi']} ({stats['asi']/stats['total']*100:.1f}%)\n"
|
|
|
|
| 227 |
text += f"- **ACI**: {stats['aci']} ({stats['aci']/stats['total']*100:.1f}%)\n"
|
| 228 |
-
text += f"- **
|
|
|
|
|
|
|
|
|
|
| 229 |
text += f"- **Not Related**: {stats['not_related']} ({stats['not_related']/stats['total']*100:.1f}%)\n"
|
| 230 |
text += f"- **Overall Relevance Rate**: {stats['relevance_rate']}%\n\n"
|
| 231 |
|
|
@@ -267,12 +280,13 @@ def generate_top_papers_text(papers: list) -> str:
|
|
| 267 |
|
| 268 |
def create_classification_chart(stats: dict) -> go.Figure:
|
| 269 |
"""Create a pie chart showing classification distribution"""
|
| 270 |
-
labels = ['
|
| 271 |
-
values = [stats['
|
| 272 |
-
stats['
|
|
|
|
| 273 |
|
| 274 |
# Modern color palette
|
| 275 |
-
colors = ['#
|
| 276 |
|
| 277 |
fig = go.Figure(data=[go.Pie(
|
| 278 |
labels=labels,
|
|
@@ -401,10 +415,13 @@ def create_scatter_chart(ranked_papers: list) -> go.Figure:
|
|
| 401 |
|
| 402 |
# Modern color palette for classifications
|
| 403 |
color_map = {
|
| 404 |
-
'AGI': '#00D4AA',
|
| 405 |
'ASI': '#7C3AED',
|
|
|
|
| 406 |
'ACI': '#F59E0B',
|
| 407 |
-
'
|
|
|
|
|
|
|
|
|
|
| 408 |
'Not Related': '#EF4444'
|
| 409 |
}
|
| 410 |
colors = [color_map.get(c, '#64748B') for c in classifications]
|
|
@@ -513,10 +530,13 @@ def analyze_trends(year: str) -> tuple:
|
|
| 513 |
weekly_stats.append({
|
| 514 |
'week': week,
|
| 515 |
'total': stats['total'],
|
| 516 |
-
'agi': stats['agi'],
|
| 517 |
'asi': stats['asi'],
|
|
|
|
| 518 |
'aci': stats['aci'],
|
| 519 |
-
'
|
|
|
|
|
|
|
|
|
|
| 520 |
'relevance_rate': stats['relevance_rate']
|
| 521 |
})
|
| 522 |
|
|
@@ -534,7 +554,7 @@ def analyze_trends(year: str) -> tuple:
|
|
| 534 |
|
| 535 |
def generate_trend_summary(year: str, weekly_stats: list) -> str:
|
| 536 |
"""Generate trend analysis summary"""
|
| 537 |
-
summary = f"# 📈
|
| 538 |
|
| 539 |
if not weekly_stats:
|
| 540 |
summary += "No weekly data available for trend analysis.\n"
|
|
@@ -543,23 +563,23 @@ def generate_trend_summary(year: str, weekly_stats: list) -> str:
|
|
| 543 |
# Calculate overall statistics
|
| 544 |
total_weeks = len(weekly_stats)
|
| 545 |
total_papers = sum(w['total'] for w in weekly_stats)
|
| 546 |
-
|
| 547 |
avg_relevance_rate = sum(w['relevance_rate'] for w in weekly_stats) / total_weeks
|
| 548 |
|
| 549 |
summary += f"## 📊 Overall Statistics\n\n"
|
| 550 |
summary += f"- **Total Weeks Analyzed**: {total_weeks}\n"
|
| 551 |
summary += f"- **Total Papers**: {total_papers}\n"
|
| 552 |
-
summary += f"- **Total
|
| 553 |
summary += f"- **Average Relevance Rate**: {avg_relevance_rate:.1f}%\n\n"
|
| 554 |
|
| 555 |
-
# Find weeks with highest
|
| 556 |
-
top_weeks = sorted(weekly_stats, key=lambda x: x['
|
| 557 |
|
| 558 |
-
summary += f"## 🏆 Top Weeks for
|
| 559 |
for i, week_stat in enumerate(top_weeks, 1):
|
| 560 |
week_name = week_stat['week'].split(' - ')[0]
|
| 561 |
-
|
| 562 |
-
summary += f"{i}. **{week_name}**: {
|
| 563 |
|
| 564 |
summary += "\n"
|
| 565 |
|
|
@@ -570,7 +590,7 @@ def create_trend_chart(week_names: list, weekly_stats: list) -> go.Figure:
|
|
| 570 |
"""Create trend visualization chart"""
|
| 571 |
# Prepare data
|
| 572 |
relevance_rates = [w['relevance_rate'] for w in weekly_stats]
|
| 573 |
-
|
| 574 |
|
| 575 |
# Create figure with secondary y-axis
|
| 576 |
fig = go.Figure()
|
|
@@ -588,16 +608,16 @@ def create_trend_chart(week_names: list, weekly_stats: list) -> go.Figure:
|
|
| 588 |
hovertemplate='<b>%{x}</b><br>Relevance Rate: %{y:.1f}%<extra></extra>'
|
| 589 |
))
|
| 590 |
|
| 591 |
-
# Add
|
| 592 |
fig.add_trace(go.Bar(
|
| 593 |
x=week_names,
|
| 594 |
-
y=
|
| 595 |
-
name='
|
| 596 |
marker=dict(
|
| 597 |
color='#EC4899',
|
| 598 |
line=dict(color='#DB2777', width=1)
|
| 599 |
),
|
| 600 |
-
hovertemplate='<b>%{x}</b><br>
|
| 601 |
yaxis='y2'
|
| 602 |
))
|
| 603 |
|
|
@@ -673,7 +693,7 @@ def create_interface():
|
|
| 673 |
secondary_hue="pink",
|
| 674 |
)
|
| 675 |
|
| 676 |
-
with gr.Blocks(title="
|
| 677 |
.gradio-container {
|
| 678 |
max-width: 1400px !important;
|
| 679 |
}
|
|
@@ -711,15 +731,15 @@ def create_interface():
|
|
| 711 |
gr.Markdown("""
|
| 712 |
<div style="text-align: center; padding: 2rem 0;">
|
| 713 |
<h1 style="font-size: 3rem; font-weight: 700; color: #1E293B; margin-bottom: 0.5rem;">
|
| 714 |
-
🧠
|
| 715 |
</h1>
|
| 716 |
<p style="font-size: 1.2rem; color: #64748B; margin-bottom: 1.5rem;">
|
| 717 |
Analyze AI papers from <a href="https://github.com/dair-ai/AI-Papers-of-the-Week" target="_blank" style="color: #6366F1; text-decoration: none; font-weight: 500;">AI-Papers-of-the-Week</a>
|
| 718 |
-
|
| 719 |
</p>
|
| 720 |
<div style="background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
|
| 721 |
padding: 1rem; border-radius: 12px; border-left: 4px solid #6366F1;">
|
| 722 |
-
<strong style="color: #6366F1;">🎓 Educational Purpose:</strong> This tool is created for educational purposes to demonstrate
|
| 723 |
</div>
|
| 724 |
</div>
|
| 725 |
""")
|
|
@@ -776,10 +796,10 @@ def create_interface():
|
|
| 776 |
|
| 777 |
papers_df = gr.Dataframe(
|
| 778 |
label="All Papers Ranking",
|
| 779 |
-
datatype=["number", "str", "markdown", "number", "number", "number", "number", "number", "str", "markdown"],
|
| 780 |
wrap=True,
|
| 781 |
-
column_widths=["80px", "400px", "150px", "80px", "80px", "80px", "80px", "80px", "100px", "120px"],
|
| 782 |
-
headers=["Rank", "Title", "Classification", "
|
| 783 |
interactive=False
|
| 784 |
)
|
| 785 |
|
|
@@ -1023,7 +1043,7 @@ if __name__ == "__main__":
|
|
| 1023 |
import sys
|
| 1024 |
|
| 1025 |
print("=" * 60)
|
| 1026 |
-
print("🧠
|
| 1027 |
print("=" * 60)
|
| 1028 |
print(f"📅 Starting at: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
|
| 1029 |
print(f"🐍 Python Version: {sys.version.split()[0]}")
|
|
|
|
| 1 |
"""
|
| 2 |
+
AI Papers Intelligence Classifier - Main Gradio Application
|
| 3 |
+
Analyzes AI papers from AI-Papers-of-the-Week across the intelligence spectrum
|
| 4 |
"""
|
| 5 |
|
| 6 |
import gradio as gr
|
|
|
|
| 10 |
from datetime import datetime
|
| 11 |
|
| 12 |
from data_fetcher import AIPapersFetcher
|
| 13 |
+
from classifier import AIPapersIntelligenceClassifier
|
| 14 |
from ranker import PaperRanker
|
| 15 |
from model_manager import ModelManager
|
| 16 |
from advanced_analyzer import AdvancedAnalyzer
|
|
|
|
| 20 |
# Initialize components
|
| 21 |
fetcher = AIPapersFetcher()
|
| 22 |
model_manager = ModelManager()
|
| 23 |
+
classifier = AIPapersIntelligenceClassifier()
|
| 24 |
reasoning_classifier = ReasoningClassifier()
|
| 25 |
ranker = PaperRanker()
|
| 26 |
advanced_analyzer = AdvancedAnalyzer()
|
|
|
|
| 29 |
def analyze_week(year: str, week: str, model_id: str = "keyword",
|
| 30 |
classification_mode: str = "keyword", use_semantic: bool = False) -> tuple:
|
| 31 |
"""
|
| 32 |
+
Analyze papers from a specific week across the intelligence spectrum
|
| 33 |
|
| 34 |
Args:
|
| 35 |
year: Year to analyze
|
|
|
|
| 147 |
# Add color-coded classification badge
|
| 148 |
classification = paper['classification_result']['classification']
|
| 149 |
classification_colors = {
|
|
|
|
| 150 |
'ASI': '#7C3AED',
|
| 151 |
+
'AGI': '#00D4AA',
|
| 152 |
'ACI': '#F59E0B',
|
| 153 |
+
'ANI': '#64748B',
|
| 154 |
+
'Other AI': '#3B82F6',
|
| 155 |
+
'ML': '#10B981',
|
| 156 |
+
'DS': '#F97316',
|
| 157 |
'Not Related': '#EF4444'
|
| 158 |
}
|
| 159 |
color = classification_colors.get(classification, '#64748B')
|
|
|
|
| 163 |
'Rank': paper.get('rank_position', 0),
|
| 164 |
'Title': paper.get('title', 'Unknown'), # Full title
|
| 165 |
'Classification': classification_html,
|
|
|
|
| 166 |
'ASI Score': paper['classification_result']['asi_score'],
|
| 167 |
+
'AGI Score': paper['classification_result']['agi_score'],
|
| 168 |
'ACI Score': paper['classification_result']['aci_score'],
|
| 169 |
+
'ANI Score': paper['classification_result']['ani_score'],
|
| 170 |
+
'Other AI Score': paper['classification_result']['other_ai_score'],
|
| 171 |
+
'ML Score': paper['classification_result']['ml_score'],
|
| 172 |
+
'DS Score': paper['classification_result']['ds_score'],
|
| 173 |
'Combined Score': paper['classification_result']['combined_score'],
|
| 174 |
'Final Rank': paper.get('final_rank', 0),
|
| 175 |
'Model': semantic_info,
|
|
|
|
| 197 |
stats: dict, relevant_papers: list, model_id: str,
|
| 198 |
use_semantic: bool) -> str:
|
| 199 |
"""Generate summary text for weekly analysis"""
|
| 200 |
+
summary = f"# 🧠 AI Papers Intelligence Classifier: {week}, {year}\n\n"
|
| 201 |
summary += f"## 📊 Overview\n\n"
|
| 202 |
summary += f"- **Analysis Method**: {'Semantic AI (' + model_id + ')' if use_semantic else 'Keyword-Based'}\n"
|
| 203 |
summary += f"- **Total Papers Analyzed**: {total_papers}\n"
|
|
|
|
| 205 |
summary += f"- **AGI Papers**: {stats['agi']}\n"
|
| 206 |
summary += f"- **ASI Papers**: {stats['asi']}\n"
|
| 207 |
summary += f"- **ACI Papers**: {stats['aci']}\n"
|
| 208 |
+
summary += f"- **ANI Papers**: {stats['ani']}\n"
|
| 209 |
+
summary += f"- **Other AI Papers**: {stats['other_ai']}\n"
|
| 210 |
+
summary += f"- **ML Papers**: {stats['ml']}\n"
|
| 211 |
+
summary += f"- **DS Papers**: {stats['ds']}\n"
|
| 212 |
summary += f"- **Not Related**: {stats['not_related']}\n"
|
| 213 |
summary += f"- **Relevance Rate**: {stats['relevance_rate']}%\n\n"
|
| 214 |
|
| 215 |
if relevant_papers:
|
| 216 |
+
summary += f"## 🎯 Top Intelligence Papers\n\n"
|
| 217 |
for i, paper in enumerate(relevant_papers[:5], 1):
|
| 218 |
title = paper.get('title', 'Unknown')
|
| 219 |
classification = paper['classification_result']['classification']
|
|
|
|
| 232 |
"""Generate statistics text"""
|
| 233 |
text = "## 📈 Classification Statistics\n\n"
|
| 234 |
text += f"- **Total Papers**: {stats['total']}\n"
|
|
|
|
| 235 |
text += f"- **ASI**: {stats['asi']} ({stats['asi']/stats['total']*100:.1f}%)\n"
|
| 236 |
+
text += f"- **AGI**: {stats['agi']} ({stats['agi']/stats['total']*100:.1f}%)\n"
|
| 237 |
text += f"- **ACI**: {stats['aci']} ({stats['aci']/stats['total']*100:.1f}%)\n"
|
| 238 |
+
text += f"- **ANI**: {stats['ani']} ({stats['ani']/stats['total']*100:.1f}%)\n"
|
| 239 |
+
text += f"- **Other AI**: {stats['other_ai']} ({stats['other_ai']/stats['total']*100:.1f}%)\n"
|
| 240 |
+
text += f"- **ML**: {stats['ml']} ({stats['ml']/stats['total']*100:.1f}%)\n"
|
| 241 |
+
text += f"- **DS**: {stats['ds']} ({stats['ds']/stats['total']*100:.1f}%)\n"
|
| 242 |
text += f"- **Not Related**: {stats['not_related']} ({stats['not_related']/stats['total']*100:.1f}%)\n"
|
| 243 |
text += f"- **Overall Relevance Rate**: {stats['relevance_rate']}%\n\n"
|
| 244 |
|
|
|
|
| 280 |
|
| 281 |
def create_classification_chart(stats: dict) -> go.Figure:
|
| 282 |
"""Create a pie chart showing classification distribution"""
|
| 283 |
+
labels = ['ASI', 'AGI', 'ACI', 'ANI', 'Other AI', 'ML', 'DS', 'Not Related']
|
| 284 |
+
values = [stats['asi'], stats['agi'], stats['aci'],
|
| 285 |
+
stats['ani'], stats['other_ai'], stats['ml'], stats['ds'],
|
| 286 |
+
stats['not_related']]
|
| 287 |
|
| 288 |
# Modern color palette
|
| 289 |
+
colors = ['#7C3AED', '#00D4AA', '#F59E0B', '#64748B', '#3B82F6', '#10B981', '#F97316', '#EF4444']
|
| 290 |
|
| 291 |
fig = go.Figure(data=[go.Pie(
|
| 292 |
labels=labels,
|
|
|
|
| 415 |
|
| 416 |
# Modern color palette for classifications
|
| 417 |
color_map = {
|
|
|
|
| 418 |
'ASI': '#7C3AED',
|
| 419 |
+
'AGI': '#00D4AA',
|
| 420 |
'ACI': '#F59E0B',
|
| 421 |
+
'ANI': '#64748B',
|
| 422 |
+
'Other AI': '#3B82F6',
|
| 423 |
+
'ML': '#10B981',
|
| 424 |
+
'DS': '#F97316',
|
| 425 |
'Not Related': '#EF4444'
|
| 426 |
}
|
| 427 |
colors = [color_map.get(c, '#64748B') for c in classifications]
|
|
|
|
| 530 |
weekly_stats.append({
|
| 531 |
'week': week,
|
| 532 |
'total': stats['total'],
|
|
|
|
| 533 |
'asi': stats['asi'],
|
| 534 |
+
'agi': stats['agi'],
|
| 535 |
'aci': stats['aci'],
|
| 536 |
+
'ani': stats['ani'],
|
| 537 |
+
'other_ai': stats['other_ai'],
|
| 538 |
+
'ml': stats['ml'],
|
| 539 |
+
'ds': stats['ds'],
|
| 540 |
'relevance_rate': stats['relevance_rate']
|
| 541 |
})
|
| 542 |
|
|
|
|
| 554 |
|
| 555 |
def generate_trend_summary(year: str, weekly_stats: list) -> str:
|
| 556 |
"""Generate trend analysis summary"""
|
| 557 |
+
summary = f"# 📈 AI Research Trends - {year}\n\n"
|
| 558 |
|
| 559 |
if not weekly_stats:
|
| 560 |
summary += "No weekly data available for trend analysis.\n"
|
|
|
|
| 563 |
# Calculate overall statistics
|
| 564 |
total_weeks = len(weekly_stats)
|
| 565 |
total_papers = sum(w['total'] for w in weekly_stats)
|
| 566 |
+
total_intelligence = sum(w['asi'] + w['agi'] + w['aci'] + w['ani'] + w['other_ai'] + w['ml'] + w['ds'] for w in weekly_stats)
|
| 567 |
avg_relevance_rate = sum(w['relevance_rate'] for w in weekly_stats) / total_weeks
|
| 568 |
|
| 569 |
summary += f"## 📊 Overall Statistics\n\n"
|
| 570 |
summary += f"- **Total Weeks Analyzed**: {total_weeks}\n"
|
| 571 |
summary += f"- **Total Papers**: {total_papers}\n"
|
| 572 |
+
summary += f"- **Total Intelligence Papers**: {total_intelligence}\n"
|
| 573 |
summary += f"- **Average Relevance Rate**: {avg_relevance_rate:.1f}%\n\n"
|
| 574 |
|
| 575 |
+
# Find weeks with highest intelligence activity
|
| 576 |
+
top_weeks = sorted(weekly_stats, key=lambda x: x['asi'] + x['agi'] + x['aci'], reverse=True)[:3]
|
| 577 |
|
| 578 |
+
summary += f"## 🏆 Top Weeks for High-Level Intelligence Research\n\n"
|
| 579 |
for i, week_stat in enumerate(top_weeks, 1):
|
| 580 |
week_name = week_stat['week'].split(' - ')[0]
|
| 581 |
+
high_level_count = week_stat['asi'] + week_stat['agi'] + week_stat['aci']
|
| 582 |
+
summary += f"{i}. **{week_name}**: {high_level_count} high-level intelligence papers ({week_stat['relevance_rate']}% relevance)\n"
|
| 583 |
|
| 584 |
summary += "\n"
|
| 585 |
|
|
|
|
| 590 |
"""Create trend visualization chart"""
|
| 591 |
# Prepare data
|
| 592 |
relevance_rates = [w['relevance_rate'] for w in weekly_stats]
|
| 593 |
+
intelligence_counts = [w['asi'] + w['agi'] + w['aci'] + w['ani'] + w['other_ai'] + w['ml'] + w['ds'] for w in weekly_stats]
|
| 594 |
|
| 595 |
# Create figure with secondary y-axis
|
| 596 |
fig = go.Figure()
|
|
|
|
| 608 |
hovertemplate='<b>%{x}</b><br>Relevance Rate: %{y:.1f}%<extra></extra>'
|
| 609 |
))
|
| 610 |
|
| 611 |
+
# Add intelligence paper count bars
|
| 612 |
fig.add_trace(go.Bar(
|
| 613 |
x=week_names,
|
| 614 |
+
y=intelligence_counts,
|
| 615 |
+
name='Intelligence Papers',
|
| 616 |
marker=dict(
|
| 617 |
color='#EC4899',
|
| 618 |
line=dict(color='#DB2777', width=1)
|
| 619 |
),
|
| 620 |
+
hovertemplate='<b>%{x}</b><br>Intelligence Papers: %{y}<extra></extra>',
|
| 621 |
yaxis='y2'
|
| 622 |
))
|
| 623 |
|
|
|
|
| 693 |
secondary_hue="pink",
|
| 694 |
)
|
| 695 |
|
| 696 |
+
with gr.Blocks(title="AI Papers Intelligence Classifier", theme=custom_theme, css="""
|
| 697 |
.gradio-container {
|
| 698 |
max-width: 1400px !important;
|
| 699 |
}
|
|
|
|
| 731 |
gr.Markdown("""
|
| 732 |
<div style="text-align: center; padding: 2rem 0;">
|
| 733 |
<h1 style="font-size: 3rem; font-weight: 700; color: #1E293B; margin-bottom: 0.5rem;">
|
| 734 |
+
🧠 AI Papers Intelligence Classifier
|
| 735 |
</h1>
|
| 736 |
<p style="font-size: 1.2rem; color: #64748B; margin-bottom: 1.5rem;">
|
| 737 |
Analyze AI papers from <a href="https://github.com/dair-ai/AI-Papers-of-the-Week" target="_blank" style="color: #6366F1; text-decoration: none; font-weight: 500;">AI-Papers-of-the-Week</a>
|
| 738 |
+
across the intelligence spectrum: ANI, AGI, ASI, ACI, ML, and DS.
|
| 739 |
</p>
|
| 740 |
<div style="background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
|
| 741 |
padding: 1rem; border-radius: 12px; border-left: 4px solid #6366F1;">
|
| 742 |
+
<strong style="color: #6366F1;">🎓 Educational Purpose:</strong> This tool is created for educational purposes to demonstrate AI research tracking and analysis across the intelligence spectrum.
|
| 743 |
</div>
|
| 744 |
</div>
|
| 745 |
""")
|
|
|
|
| 796 |
|
| 797 |
papers_df = gr.Dataframe(
|
| 798 |
label="All Papers Ranking",
|
| 799 |
+
datatype=["number", "str", "markdown", "number", "number", "number", "number", "number", "number", "number", "number", "number", "str", "markdown"],
|
| 800 |
wrap=True,
|
| 801 |
+
column_widths=["80px", "400px", "150px", "80px", "80px", "80px", "80px", "80px", "80px", "80px", "80px", "80px", "100px", "120px"],
|
| 802 |
+
headers=["Rank", "Title", "Classification", "ASI Score", "AGI Score", "ACI Score", "ANI Score", "Other AI Score", "ML Score", "DS Score", "Combined Score", "Final Rank", "Model", "Links"],
|
| 803 |
interactive=False
|
| 804 |
)
|
| 805 |
|
|
|
|
| 1043 |
import sys
|
| 1044 |
|
| 1045 |
print("=" * 60)
|
| 1046 |
+
print("🧠 AI Papers Intelligence Classifier - Application Startup")
|
| 1047 |
print("=" * 60)
|
| 1048 |
print(f"📅 Starting at: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
|
| 1049 |
print(f"🐍 Python Version: {sys.version.split()[0]}")
|
|
@@ -1,14 +1,14 @@
|
|
| 1 |
"""
|
| 2 |
-
|
| 3 |
-
Classifies AI papers
|
| 4 |
"""
|
| 5 |
|
| 6 |
from typing import Dict, List
|
| 7 |
from model_manager import ModelManager
|
| 8 |
|
| 9 |
|
| 10 |
-
class
|
| 11 |
-
"""Classify papers
|
| 12 |
|
| 13 |
def __init__(self, use_semantic: bool = False, model_id: str = "keyword"):
|
| 14 |
# Initialize model manager for semantic analysis
|
|
@@ -156,10 +156,129 @@ class AGIASIClassifier:
|
|
| 156 |
"ant colony optimization",
|
| 157 |
"distributed problem solving"
|
| 158 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
|
| 160 |
def classify_paper(self, paper_data: Dict) -> Dict:
|
| 161 |
"""
|
| 162 |
-
Classify a paper
|
| 163 |
|
| 164 |
Args:
|
| 165 |
paper_data: Dictionary containing paper information (title, summary, etc.)
|
|
@@ -174,10 +293,14 @@ class AGIASIClassifier:
|
|
| 174 |
# Combine all text for analysis
|
| 175 |
combined_text = f"{title} {summary} {full_entry}"
|
| 176 |
|
| 177 |
-
# Calculate scores
|
| 178 |
-
agi_score = self.calculate_keyword_score(combined_text, self.agi_keywords)
|
| 179 |
asi_score = self.calculate_keyword_score(combined_text, self.asi_keywords)
|
|
|
|
| 180 |
aci_score = self.calculate_keyword_score(combined_text, self.aci_keywords)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
related_score = self.calculate_keyword_score(combined_text, self.related_keywords)
|
| 182 |
|
| 183 |
# Perform semantic analysis if enabled
|
|
@@ -186,22 +309,34 @@ class AGIASIClassifier:
|
|
| 186 |
semantic_result = self.model_manager.analyze_paper_semantic(paper_data, self.model_id)
|
| 187 |
|
| 188 |
# Determine classification
|
| 189 |
-
classification = self.determine_classification(
|
|
|
|
|
|
|
| 190 |
|
| 191 |
# Calculate combined relevance score (incorporating semantic if available)
|
| 192 |
-
combined_score = self.calculate_combined_score(
|
|
|
|
|
|
|
| 193 |
|
| 194 |
return {
|
| 195 |
'classification': classification['level'],
|
| 196 |
'classification_reason': classification['reason'],
|
| 197 |
-
'agi_score': agi_score,
|
| 198 |
'asi_score': asi_score,
|
|
|
|
| 199 |
'aci_score': aci_score,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 200 |
'related_score': related_score,
|
| 201 |
'combined_score': combined_score,
|
| 202 |
'matched_agi_keywords': self.find_matched_keywords(combined_text, self.agi_keywords),
|
| 203 |
'matched_asi_keywords': self.find_matched_keywords(combined_text, self.asi_keywords),
|
| 204 |
'matched_aci_keywords': self.find_matched_keywords(combined_text, self.aci_keywords),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
'matched_related_keywords': self.find_matched_keywords(combined_text, self.related_keywords),
|
| 206 |
'semantic_analysis': semantic_result
|
| 207 |
}
|
|
@@ -231,15 +366,17 @@ class AGIASIClassifier:
|
|
| 231 |
matched.append(keyword)
|
| 232 |
return matched
|
| 233 |
|
| 234 |
-
def determine_classification(self,
|
| 235 |
-
|
|
|
|
| 236 |
"""
|
| 237 |
-
Determine classification level based on scores
|
| 238 |
|
| 239 |
Returns:
|
| 240 |
Dictionary with classification level and reasoning
|
| 241 |
"""
|
| 242 |
-
|
|
|
|
| 243 |
|
| 244 |
# If semantic analysis is available, use it to enhance classification
|
| 245 |
if semantic_result and semantic_result.get("semantic_relevance", 0) > 70:
|
|
@@ -250,25 +387,32 @@ class AGIASIClassifier:
|
|
| 250 |
'reason': f"Semantic analysis classification with {semantic_result['semantic_relevance']}% confidence"
|
| 251 |
}
|
| 252 |
# High semantic relevance boosts classification
|
| 253 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 254 |
return {
|
| 255 |
-
'level':
|
| 256 |
-
'reason': f"High semantic relevance ({semantic_result['semantic_relevance']}) with {
|
| 257 |
}
|
| 258 |
|
| 259 |
-
#
|
| 260 |
-
if
|
| 261 |
return {
|
| 262 |
-
'level': "
|
| 263 |
-
'reason': f"Strong
|
| 264 |
}
|
| 265 |
-
elif
|
| 266 |
return {
|
| 267 |
-
'level': "
|
| 268 |
-
'reason': f"
|
| 269 |
}
|
| 270 |
|
| 271 |
-
# AGI classification
|
| 272 |
if agi_score >= 3:
|
| 273 |
return {
|
| 274 |
'level': "AGI",
|
|
@@ -280,54 +424,103 @@ class AGIASIClassifier:
|
|
| 280 |
'reason': f"Good general intelligence relevance with {agi_score} AGI keyword matches"
|
| 281 |
}
|
| 282 |
|
| 283 |
-
#
|
| 284 |
-
if
|
| 285 |
return {
|
| 286 |
-
'level': "
|
| 287 |
-
'reason': f"Strong
|
| 288 |
}
|
| 289 |
-
elif
|
| 290 |
return {
|
| 291 |
-
'level': "
|
| 292 |
-
'reason': f"Good
|
| 293 |
}
|
| 294 |
|
| 295 |
-
#
|
| 296 |
-
if
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 308 |
return {
|
| 309 |
-
'level': "
|
| 310 |
'reason': f"Related AI research with {related_score} related keyword matches"
|
| 311 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 312 |
else:
|
| 313 |
return {
|
| 314 |
'level': "Not Related",
|
| 315 |
'reason': "No significant AI relevance detected"
|
| 316 |
}
|
| 317 |
|
| 318 |
-
def calculate_combined_score(self,
|
| 319 |
-
|
|
|
|
| 320 |
"""
|
| 321 |
Calculate combined relevance score (0-100 scale)
|
| 322 |
|
| 323 |
Weights:
|
| 324 |
-
-
|
| 325 |
-
-
|
| 326 |
- ACI keywords: 2.5 (emerging field, high potential)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 327 |
- Related keywords: 1.0 (contextual)
|
| 328 |
- Semantic analysis: 2.0 (if available)
|
| 329 |
"""
|
| 330 |
-
weighted_score = (
|
|
|
|
|
|
|
| 331 |
|
| 332 |
# Add semantic score if available
|
| 333 |
if semantic_result and semantic_result.get("semantic_relevance"):
|
|
@@ -373,39 +566,52 @@ class AGIASIClassifier:
|
|
| 373 |
if total == 0:
|
| 374 |
return {
|
| 375 |
'total': 0,
|
| 376 |
-
'agi': 0,
|
| 377 |
'asi': 0,
|
|
|
|
| 378 |
'aci': 0,
|
| 379 |
-
'
|
|
|
|
|
|
|
|
|
|
| 380 |
'not_related': 0,
|
| 381 |
'relevance_rate': 0.0
|
| 382 |
}
|
| 383 |
|
| 384 |
stats = {
|
| 385 |
'total': total,
|
| 386 |
-
'agi': 0,
|
| 387 |
'asi': 0,
|
|
|
|
| 388 |
'aci': 0,
|
| 389 |
-
'
|
|
|
|
|
|
|
|
|
|
| 390 |
'not_related': 0,
|
| 391 |
'relevance_rate': 0.0
|
| 392 |
}
|
| 393 |
|
| 394 |
for paper in classified_papers:
|
| 395 |
level = paper['classification_result']['classification']
|
| 396 |
-
if level == "
|
| 397 |
-
stats['agi'] += 1
|
| 398 |
-
elif level == "ASI":
|
| 399 |
stats['asi'] += 1
|
|
|
|
|
|
|
| 400 |
elif level == "ACI":
|
| 401 |
stats['aci'] += 1
|
| 402 |
-
elif level == "
|
| 403 |
-
stats['
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 404 |
else:
|
| 405 |
stats['not_related'] += 1
|
| 406 |
|
| 407 |
# Calculate relevance rate (papers that are not "Not Related")
|
| 408 |
-
relevant_count = stats['
|
|
|
|
| 409 |
stats['relevance_rate'] = round((relevant_count / total) * 100, 2)
|
| 410 |
|
| 411 |
return stats
|
|
|
|
| 1 |
"""
|
| 2 |
+
AI Papers Intelligence Classifier Module
|
| 3 |
+
Classifies AI papers across the intelligence spectrum: ANI, AGI, ASI, ACI, ML, DS
|
| 4 |
"""
|
| 5 |
|
| 6 |
from typing import Dict, List
|
| 7 |
from model_manager import ModelManager
|
| 8 |
|
| 9 |
|
| 10 |
+
class AIPapersIntelligenceClassifier:
|
| 11 |
+
"""Classify papers across the intelligence spectrum using keyword analysis"""
|
| 12 |
|
| 13 |
def __init__(self, use_semantic: bool = False, model_id: str = "keyword"):
|
| 14 |
# Initialize model manager for semantic analysis
|
|
|
|
| 156 |
"ant colony optimization",
|
| 157 |
"distributed problem solving"
|
| 158 |
]
|
| 159 |
+
|
| 160 |
+
# ANI (Artificial Narrow Intelligence) keywords
|
| 161 |
+
self.ani_keywords = [
|
| 162 |
+
"narrow AI",
|
| 163 |
+
"specialized AI",
|
| 164 |
+
"task-specific AI",
|
| 165 |
+
"domain-specific",
|
| 166 |
+
"expert systems",
|
| 167 |
+
"single-purpose AI",
|
| 168 |
+
"focused AI",
|
| 169 |
+
"specialized neural networks",
|
| 170 |
+
"task optimization",
|
| 171 |
+
"specific domain",
|
| 172 |
+
"narrow intelligence",
|
| 173 |
+
"specialized intelligence",
|
| 174 |
+
"task-oriented AI",
|
| 175 |
+
"domain-specific AI",
|
| 176 |
+
"application-specific AI",
|
| 177 |
+
"vertical AI",
|
| 178 |
+
"specialized machine learning",
|
| 179 |
+
"narrow systems",
|
| 180 |
+
"specialized systems",
|
| 181 |
+
"task-focused AI"
|
| 182 |
+
]
|
| 183 |
+
|
| 184 |
+
# Other AI keywords
|
| 185 |
+
self.other_ai_keywords = [
|
| 186 |
+
"artificial intelligence",
|
| 187 |
+
"AI research",
|
| 188 |
+
"AI applications",
|
| 189 |
+
"AI systems",
|
| 190 |
+
"computer vision",
|
| 191 |
+
"natural language processing",
|
| 192 |
+
"NLP",
|
| 193 |
+
"speech recognition",
|
| 194 |
+
"robotics",
|
| 195 |
+
"autonomous systems",
|
| 196 |
+
"AI technology",
|
| 197 |
+
"AI algorithms",
|
| 198 |
+
"AI methods",
|
| 199 |
+
"AI techniques",
|
| 200 |
+
"intelligent systems",
|
| 201 |
+
"smart systems",
|
| 202 |
+
"cognitive computing",
|
| 203 |
+
"intelligent agents",
|
| 204 |
+
"AI platforms",
|
| 205 |
+
"AI frameworks"
|
| 206 |
+
]
|
| 207 |
+
|
| 208 |
+
# ML (Machine Learning) keywords
|
| 209 |
+
self.ml_keywords = [
|
| 210 |
+
"machine learning",
|
| 211 |
+
"deep learning",
|
| 212 |
+
"neural networks",
|
| 213 |
+
"CNN",
|
| 214 |
+
"convolutional neural networks",
|
| 215 |
+
"RNN",
|
| 216 |
+
"recurrent neural networks",
|
| 217 |
+
"Transformer",
|
| 218 |
+
"transformer models",
|
| 219 |
+
"supervised learning",
|
| 220 |
+
"unsupervised learning",
|
| 221 |
+
"reinforcement learning",
|
| 222 |
+
"feature engineering",
|
| 223 |
+
"model training",
|
| 224 |
+
"neural architecture",
|
| 225 |
+
"gradient descent",
|
| 226 |
+
"backpropagation",
|
| 227 |
+
"loss function",
|
| 228 |
+
"optimization",
|
| 229 |
+
"hyperparameter tuning",
|
| 230 |
+
"model architecture",
|
| 231 |
+
"deep neural networks",
|
| 232 |
+
"feedforward networks",
|
| 233 |
+
"activation functions",
|
| 234 |
+
"regularization",
|
| 235 |
+
"batch normalization",
|
| 236 |
+
"dropout",
|
| 237 |
+
"attention mechanism",
|
| 238 |
+
"self-attention",
|
| 239 |
+
"embeddings",
|
| 240 |
+
"representation learning"
|
| 241 |
+
]
|
| 242 |
+
|
| 243 |
+
# DS (Data Science) keywords
|
| 244 |
+
self.ds_keywords = [
|
| 245 |
+
"data science",
|
| 246 |
+
"data analysis",
|
| 247 |
+
"data mining",
|
| 248 |
+
"big data",
|
| 249 |
+
"statistical analysis",
|
| 250 |
+
"data visualization",
|
| 251 |
+
"data engineering",
|
| 252 |
+
"data pipelines",
|
| 253 |
+
"data preprocessing",
|
| 254 |
+
"feature extraction",
|
| 255 |
+
"data wrangling",
|
| 256 |
+
"data cleaning",
|
| 257 |
+
"exploratory data analysis",
|
| 258 |
+
"EDA",
|
| 259 |
+
"statistical modeling",
|
| 260 |
+
"predictive analytics",
|
| 261 |
+
"descriptive analytics",
|
| 262 |
+
"data analytics",
|
| 263 |
+
"business intelligence",
|
| 264 |
+
"data warehousing",
|
| 265 |
+
"ETL",
|
| 266 |
+
"extract transform load",
|
| 267 |
+
"data integration",
|
| 268 |
+
"data quality",
|
| 269 |
+
"data governance",
|
| 270 |
+
"data management",
|
| 271 |
+
"statistical methods",
|
| 272 |
+
"hypothesis testing",
|
| 273 |
+
"regression analysis",
|
| 274 |
+
"classification algorithms",
|
| 275 |
+
"clustering",
|
| 276 |
+
"dimensionality reduction"
|
| 277 |
+
]
|
| 278 |
|
| 279 |
def classify_paper(self, paper_data: Dict) -> Dict:
|
| 280 |
"""
|
| 281 |
+
Classify a paper across the intelligence spectrum
|
| 282 |
|
| 283 |
Args:
|
| 284 |
paper_data: Dictionary containing paper information (title, summary, etc.)
|
|
|
|
| 293 |
# Combine all text for analysis
|
| 294 |
combined_text = f"{title} {summary} {full_entry}"
|
| 295 |
|
| 296 |
+
# Calculate scores for all intelligence levels
|
|
|
|
| 297 |
asi_score = self.calculate_keyword_score(combined_text, self.asi_keywords)
|
| 298 |
+
agi_score = self.calculate_keyword_score(combined_text, self.agi_keywords)
|
| 299 |
aci_score = self.calculate_keyword_score(combined_text, self.aci_keywords)
|
| 300 |
+
ani_score = self.calculate_keyword_score(combined_text, self.ani_keywords)
|
| 301 |
+
other_ai_score = self.calculate_keyword_score(combined_text, self.other_ai_keywords)
|
| 302 |
+
ml_score = self.calculate_keyword_score(combined_text, self.ml_keywords)
|
| 303 |
+
ds_score = self.calculate_keyword_score(combined_text, self.ds_keywords)
|
| 304 |
related_score = self.calculate_keyword_score(combined_text, self.related_keywords)
|
| 305 |
|
| 306 |
# Perform semantic analysis if enabled
|
|
|
|
| 309 |
semantic_result = self.model_manager.analyze_paper_semantic(paper_data, self.model_id)
|
| 310 |
|
| 311 |
# Determine classification
|
| 312 |
+
classification = self.determine_classification(asi_score, agi_score, aci_score, ani_score,
|
| 313 |
+
other_ai_score, ml_score, ds_score,
|
| 314 |
+
related_score, semantic_result)
|
| 315 |
|
| 316 |
# Calculate combined relevance score (incorporating semantic if available)
|
| 317 |
+
combined_score = self.calculate_combined_score(asi_score, agi_score, aci_score, ani_score,
|
| 318 |
+
other_ai_score, ml_score, ds_score,
|
| 319 |
+
related_score, semantic_result)
|
| 320 |
|
| 321 |
return {
|
| 322 |
'classification': classification['level'],
|
| 323 |
'classification_reason': classification['reason'],
|
|
|
|
| 324 |
'asi_score': asi_score,
|
| 325 |
+
'agi_score': agi_score,
|
| 326 |
'aci_score': aci_score,
|
| 327 |
+
'ani_score': ani_score,
|
| 328 |
+
'other_ai_score': other_ai_score,
|
| 329 |
+
'ml_score': ml_score,
|
| 330 |
+
'ds_score': ds_score,
|
| 331 |
'related_score': related_score,
|
| 332 |
'combined_score': combined_score,
|
| 333 |
'matched_agi_keywords': self.find_matched_keywords(combined_text, self.agi_keywords),
|
| 334 |
'matched_asi_keywords': self.find_matched_keywords(combined_text, self.asi_keywords),
|
| 335 |
'matched_aci_keywords': self.find_matched_keywords(combined_text, self.aci_keywords),
|
| 336 |
+
'matched_ani_keywords': self.find_matched_keywords(combined_text, self.ani_keywords),
|
| 337 |
+
'matched_other_ai_keywords': self.find_matched_keywords(combined_text, self.other_ai_keywords),
|
| 338 |
+
'matched_ml_keywords': self.find_matched_keywords(combined_text, self.ml_keywords),
|
| 339 |
+
'matched_ds_keywords': self.find_matched_keywords(combined_text, self.ds_keywords),
|
| 340 |
'matched_related_keywords': self.find_matched_keywords(combined_text, self.related_keywords),
|
| 341 |
'semantic_analysis': semantic_result
|
| 342 |
}
|
|
|
|
| 366 |
matched.append(keyword)
|
| 367 |
return matched
|
| 368 |
|
| 369 |
+
def determine_classification(self, asi_score: int, agi_score: int, aci_score: int,
|
| 370 |
+
ani_score: int, other_ai_score: int, ml_score: int,
|
| 371 |
+
ds_score: int, related_score: int, semantic_result: Dict = None) -> Dict:
|
| 372 |
"""
|
| 373 |
+
Determine classification level based on scores across the intelligence spectrum
|
| 374 |
|
| 375 |
Returns:
|
| 376 |
Dictionary with classification level and reasoning
|
| 377 |
"""
|
| 378 |
+
# Calculate max scores for high-level intelligence
|
| 379 |
+
max_high_level_score = max(asi_score, agi_score, aci_score)
|
| 380 |
|
| 381 |
# If semantic analysis is available, use it to enhance classification
|
| 382 |
if semantic_result and semantic_result.get("semantic_relevance", 0) > 70:
|
|
|
|
| 387 |
'reason': f"Semantic analysis classification with {semantic_result['semantic_relevance']}% confidence"
|
| 388 |
}
|
| 389 |
# High semantic relevance boosts classification
|
| 390 |
+
if max_high_level_score >= 1:
|
| 391 |
+
# Determine which high-level category has highest score
|
| 392 |
+
if asi_score >= agi_score and asi_score >= aci_score:
|
| 393 |
+
level = "ASI"
|
| 394 |
+
elif agi_score >= asi_score and agi_score >= aci_score:
|
| 395 |
+
level = "AGI"
|
| 396 |
+
else:
|
| 397 |
+
level = "ACI"
|
| 398 |
return {
|
| 399 |
+
'level': level,
|
| 400 |
+
'reason': f"High semantic relevance ({semantic_result['semantic_relevance']}) with {max_high_level_score} high-level keyword matches"
|
| 401 |
}
|
| 402 |
|
| 403 |
+
# ASI classification (highest priority - superintelligence)
|
| 404 |
+
if asi_score >= 3:
|
| 405 |
return {
|
| 406 |
+
'level': "ASI",
|
| 407 |
+
'reason': f"Strong superintelligence focus with {asi_score} ASI keyword matches"
|
| 408 |
}
|
| 409 |
+
elif asi_score >= 2:
|
| 410 |
return {
|
| 411 |
+
'level': "ASI",
|
| 412 |
+
'reason': f"Good superintelligence relevance with {asi_score} ASI keyword matches"
|
| 413 |
}
|
| 414 |
|
| 415 |
+
# AGI classification (second highest priority)
|
| 416 |
if agi_score >= 3:
|
| 417 |
return {
|
| 418 |
'level': "AGI",
|
|
|
|
| 424 |
'reason': f"Good general intelligence relevance with {agi_score} AGI keyword matches"
|
| 425 |
}
|
| 426 |
|
| 427 |
+
# ACI classification (third highest priority)
|
| 428 |
+
if aci_score >= 3:
|
| 429 |
return {
|
| 430 |
+
'level': "ACI",
|
| 431 |
+
'reason': f"Strong collective intelligence focus with {aci_score} ACI keyword matches"
|
| 432 |
}
|
| 433 |
+
elif aci_score >= 2:
|
| 434 |
return {
|
| 435 |
+
'level': "ACI",
|
| 436 |
+
'reason': f"Good collective intelligence relevance with {aci_score} ACI keyword matches"
|
| 437 |
}
|
| 438 |
|
| 439 |
+
# ANI classification (narrow/specialized AI)
|
| 440 |
+
if ani_score >= 3:
|
| 441 |
+
return {
|
| 442 |
+
'level': "ANI",
|
| 443 |
+
'reason': f"Strong narrow AI focus with {ani_score} ANI keyword matches"
|
| 444 |
+
}
|
| 445 |
+
elif ani_score >= 2:
|
| 446 |
+
return {
|
| 447 |
+
'level': "ANI",
|
| 448 |
+
'reason': f"Good narrow AI relevance with {ani_score} ANI keyword matches"
|
| 449 |
+
}
|
| 450 |
+
|
| 451 |
+
# Other AI classification (general AI topics)
|
| 452 |
+
if other_ai_score >= 3:
|
| 453 |
+
return {
|
| 454 |
+
'level': "Other AI",
|
| 455 |
+
'reason': f"Strong general AI focus with {other_ai_score} Other AI keyword matches"
|
| 456 |
+
}
|
| 457 |
+
elif other_ai_score >= 2:
|
| 458 |
+
return {
|
| 459 |
+
'level': "Other AI",
|
| 460 |
+
'reason': f"Good general AI relevance with {other_ai_score} Other AI keyword matches"
|
| 461 |
+
}
|
| 462 |
+
|
| 463 |
+
# ML classification (machine learning focus)
|
| 464 |
+
if ml_score >= 3:
|
| 465 |
+
return {
|
| 466 |
+
'level': "ML",
|
| 467 |
+
'reason': f"Strong machine learning focus with {ml_score} ML keyword matches"
|
| 468 |
+
}
|
| 469 |
+
elif ml_score >= 2:
|
| 470 |
+
return {
|
| 471 |
+
'level': "ML",
|
| 472 |
+
'reason': f"Good machine learning relevance with {ml_score} ML keyword matches"
|
| 473 |
+
}
|
| 474 |
+
|
| 475 |
+
# DS classification (data science focus)
|
| 476 |
+
if ds_score >= 3:
|
| 477 |
+
return {
|
| 478 |
+
'level': "DS",
|
| 479 |
+
'reason': f"Strong data science focus with {ds_score} DS keyword matches"
|
| 480 |
+
}
|
| 481 |
+
elif ds_score >= 2:
|
| 482 |
+
return {
|
| 483 |
+
'level': "DS",
|
| 484 |
+
'reason': f"Good data science relevance with {ds_score} DS keyword matches"
|
| 485 |
+
}
|
| 486 |
+
|
| 487 |
+
# Fallback to related keywords or not related
|
| 488 |
+
if related_score >= 5:
|
| 489 |
return {
|
| 490 |
+
'level': "Other AI",
|
| 491 |
'reason': f"Related AI research with {related_score} related keyword matches"
|
| 492 |
}
|
| 493 |
+
elif related_score >= 3:
|
| 494 |
+
return {
|
| 495 |
+
'level': "Other AI",
|
| 496 |
+
'reason': f"Some AI relevance with {related_score} related keyword matches"
|
| 497 |
+
}
|
| 498 |
else:
|
| 499 |
return {
|
| 500 |
'level': "Not Related",
|
| 501 |
'reason': "No significant AI relevance detected"
|
| 502 |
}
|
| 503 |
|
| 504 |
+
def calculate_combined_score(self, asi_score: int, agi_score: int, aci_score: int,
|
| 505 |
+
ani_score: int, other_ai_score: int, ml_score: int,
|
| 506 |
+
ds_score: int, related_score: int, semantic_result: Dict = None) -> float:
|
| 507 |
"""
|
| 508 |
Calculate combined relevance score (0-100 scale)
|
| 509 |
|
| 510 |
Weights:
|
| 511 |
+
- ASI keywords: 3.0 (highest importance)
|
| 512 |
+
- AGI keywords: 3.0 (highest importance)
|
| 513 |
- ACI keywords: 2.5 (emerging field, high potential)
|
| 514 |
+
- ANI keywords: 2.0 (specialized AI)
|
| 515 |
+
- Other AI keywords: 1.5 (general AI)
|
| 516 |
+
- ML keywords: 1.5 (machine learning)
|
| 517 |
+
- DS keywords: 1.0 (data science)
|
| 518 |
- Related keywords: 1.0 (contextual)
|
| 519 |
- Semantic analysis: 2.0 (if available)
|
| 520 |
"""
|
| 521 |
+
weighted_score = (asi_score * 3.0) + (agi_score * 3.0) + (aci_score * 2.5) + \
|
| 522 |
+
(ani_score * 2.0) + (other_ai_score * 1.5) + (ml_score * 1.5) + \
|
| 523 |
+
(ds_score * 1.0) + (related_score * 1.0)
|
| 524 |
|
| 525 |
# Add semantic score if available
|
| 526 |
if semantic_result and semantic_result.get("semantic_relevance"):
|
|
|
|
| 566 |
if total == 0:
|
| 567 |
return {
|
| 568 |
'total': 0,
|
|
|
|
| 569 |
'asi': 0,
|
| 570 |
+
'agi': 0,
|
| 571 |
'aci': 0,
|
| 572 |
+
'ani': 0,
|
| 573 |
+
'other_ai': 0,
|
| 574 |
+
'ml': 0,
|
| 575 |
+
'ds': 0,
|
| 576 |
'not_related': 0,
|
| 577 |
'relevance_rate': 0.0
|
| 578 |
}
|
| 579 |
|
| 580 |
stats = {
|
| 581 |
'total': total,
|
|
|
|
| 582 |
'asi': 0,
|
| 583 |
+
'agi': 0,
|
| 584 |
'aci': 0,
|
| 585 |
+
'ani': 0,
|
| 586 |
+
'other_ai': 0,
|
| 587 |
+
'ml': 0,
|
| 588 |
+
'ds': 0,
|
| 589 |
'not_related': 0,
|
| 590 |
'relevance_rate': 0.0
|
| 591 |
}
|
| 592 |
|
| 593 |
for paper in classified_papers:
|
| 594 |
level = paper['classification_result']['classification']
|
| 595 |
+
if level == "ASI":
|
|
|
|
|
|
|
| 596 |
stats['asi'] += 1
|
| 597 |
+
elif level == "AGI":
|
| 598 |
+
stats['agi'] += 1
|
| 599 |
elif level == "ACI":
|
| 600 |
stats['aci'] += 1
|
| 601 |
+
elif level == "ANI":
|
| 602 |
+
stats['ani'] += 1
|
| 603 |
+
elif level == "Other AI":
|
| 604 |
+
stats['other_ai'] += 1
|
| 605 |
+
elif level == "ML":
|
| 606 |
+
stats['ml'] += 1
|
| 607 |
+
elif level == "DS":
|
| 608 |
+
stats['ds'] += 1
|
| 609 |
else:
|
| 610 |
stats['not_related'] += 1
|
| 611 |
|
| 612 |
# Calculate relevance rate (papers that are not "Not Related")
|
| 613 |
+
relevant_count = stats['asi'] + stats['agi'] + stats['aci'] + stats['ani'] + \
|
| 614 |
+
stats['other_ai'] + stats['ml'] + stats['ds']
|
| 615 |
stats['relevance_rate'] = round((relevant_count / total) * 100, 2)
|
| 616 |
|
| 617 |
return stats
|
|
@@ -140,28 +140,35 @@ class PaperRanker:
|
|
| 140 |
|
| 141 |
# Base score from classification level
|
| 142 |
level_scores = {
|
| 143 |
-
'
|
| 144 |
-
'
|
| 145 |
-
'ACI': 85.0,
|
| 146 |
-
'
|
|
|
|
|
|
|
|
|
|
| 147 |
'Not Related': 10.0
|
| 148 |
}
|
| 149 |
|
| 150 |
base_score = level_scores.get(level, 10.0)
|
| 151 |
|
| 152 |
-
# Bonus for ASI keywords (
|
| 153 |
asi_matches = len(classification.get('matched_asi_keywords', []))
|
| 154 |
asi_bonus = min(asi_matches * 5.0, 10.0)
|
| 155 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
# Bonus for ACI keywords (emerging field potential)
|
| 157 |
aci_matches = len(classification.get('matched_aci_keywords', []))
|
| 158 |
aci_bonus = min(aci_matches * 5.0, 10.0)
|
| 159 |
|
| 160 |
-
# Bonus for
|
| 161 |
-
|
| 162 |
-
|
| 163 |
|
| 164 |
-
impact_score = min(base_score + asi_bonus + aci_bonus +
|
| 165 |
|
| 166 |
return round(impact_score, 2)
|
| 167 |
|
|
@@ -182,7 +189,7 @@ class PaperRanker:
|
|
| 182 |
return ranked[:top_n]
|
| 183 |
|
| 184 |
def filter_by_classification(self, papers: List[Dict],
|
| 185 |
-
min_level: str = '
|
| 186 |
"""
|
| 187 |
Filter papers by minimum classification level
|
| 188 |
|
|
@@ -195,10 +202,13 @@ class PaperRanker:
|
|
| 195 |
"""
|
| 196 |
level_hierarchy = {
|
| 197 |
'Not Related': 0,
|
| 198 |
-
'
|
| 199 |
-
'
|
| 200 |
-
'
|
| 201 |
-
'
|
|
|
|
|
|
|
|
|
|
| 202 |
}
|
| 203 |
|
| 204 |
min_level_value = level_hierarchy.get(min_level, 0)
|
|
|
|
| 140 |
|
| 141 |
# Base score from classification level
|
| 142 |
level_scores = {
|
| 143 |
+
'ASI': 95.0, # Highest impact - superintelligence
|
| 144 |
+
'AGI': 90.0, # Very high impact - general intelligence
|
| 145 |
+
'ACI': 85.0, # High impact - collective intelligence
|
| 146 |
+
'ANI': 70.0, # Medium-high impact - narrow intelligence
|
| 147 |
+
'Other AI': 60.0, # Medium impact - general AI
|
| 148 |
+
'ML': 50.0, # Medium impact - machine learning
|
| 149 |
+
'DS': 40.0, # Lower impact - data science
|
| 150 |
'Not Related': 10.0
|
| 151 |
}
|
| 152 |
|
| 153 |
base_score = level_scores.get(level, 10.0)
|
| 154 |
|
| 155 |
+
# Bonus for ASI keywords (highest potential impact)
|
| 156 |
asi_matches = len(classification.get('matched_asi_keywords', []))
|
| 157 |
asi_bonus = min(asi_matches * 5.0, 10.0)
|
| 158 |
|
| 159 |
+
# Bonus for AGI keywords (high potential impact)
|
| 160 |
+
agi_matches = len(classification.get('matched_agi_keywords', []))
|
| 161 |
+
agi_bonus = min(agi_matches * 5.0, 10.0)
|
| 162 |
+
|
| 163 |
# Bonus for ACI keywords (emerging field potential)
|
| 164 |
aci_matches = len(classification.get('matched_aci_keywords', []))
|
| 165 |
aci_bonus = min(aci_matches * 5.0, 10.0)
|
| 166 |
|
| 167 |
+
# Bonus for ANI keywords (specialized AI impact)
|
| 168 |
+
ani_matches = len(classification.get('matched_ani_keywords', []))
|
| 169 |
+
ani_bonus = min(ani_matches * 3.0, 5.0)
|
| 170 |
|
| 171 |
+
impact_score = min(base_score + asi_bonus + agi_bonus + aci_bonus + ani_bonus, 100.0)
|
| 172 |
|
| 173 |
return round(impact_score, 2)
|
| 174 |
|
|
|
|
| 189 |
return ranked[:top_n]
|
| 190 |
|
| 191 |
def filter_by_classification(self, papers: List[Dict],
|
| 192 |
+
min_level: str = 'Other AI') -> List[Dict]:
|
| 193 |
"""
|
| 194 |
Filter papers by minimum classification level
|
| 195 |
|
|
|
|
| 202 |
"""
|
| 203 |
level_hierarchy = {
|
| 204 |
'Not Related': 0,
|
| 205 |
+
'DS': 1, # Data Science
|
| 206 |
+
'ML': 2, # Machine Learning
|
| 207 |
+
'Other AI': 3, # General AI topics
|
| 208 |
+
'ANI': 4, # Artificial Narrow Intelligence
|
| 209 |
+
'ACI': 5, # Artificial Collective Intelligence
|
| 210 |
+
'AGI': 6, # Artificial General Intelligence
|
| 211 |
+
'ASI': 7 # Artificial Super Intelligence (Highest)
|
| 212 |
}
|
| 213 |
|
| 214 |
min_level_value = level_hierarchy.get(min_level, 0)
|
|
@@ -3,27 +3,31 @@ Test suite for classifier module
|
|
| 3 |
"""
|
| 4 |
|
| 5 |
import pytest
|
| 6 |
-
from classifier import
|
| 7 |
|
| 8 |
|
| 9 |
def test_classifier_initialization():
|
| 10 |
"""Test that classifier initializes correctly"""
|
| 11 |
-
classifier =
|
| 12 |
assert classifier.agi_keywords is not None
|
| 13 |
assert classifier.asi_keywords is not None
|
| 14 |
-
assert classifier.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
def test_classifier_with_semantic():
|
| 18 |
"""Test classifier with semantic analysis enabled"""
|
| 19 |
-
classifier =
|
| 20 |
assert classifier.use_semantic == True
|
| 21 |
assert classifier.model_id == "keyword"
|
| 22 |
|
| 23 |
|
| 24 |
def test_classify_paper():
|
| 25 |
"""Test paper classification"""
|
| 26 |
-
classifier =
|
| 27 |
|
| 28 |
test_paper = {
|
| 29 |
'title': 'Neural Computers: A New Computing Paradigm',
|
|
@@ -35,17 +39,26 @@ def test_classify_paper():
|
|
| 35 |
|
| 36 |
assert 'classification' in result
|
| 37 |
assert 'classification_reason' in result
|
| 38 |
-
assert 'agi_score' in result
|
| 39 |
assert 'asi_score' in result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
assert 'combined_score' in result
|
| 41 |
assert 'matched_agi_keywords' in result
|
| 42 |
assert 'matched_asi_keywords' in result
|
| 43 |
-
assert '
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
|
| 46 |
def test_classify_paper_agi():
|
| 47 |
"""Test classification of AGI paper"""
|
| 48 |
-
classifier =
|
| 49 |
|
| 50 |
agi_paper = {
|
| 51 |
'title': 'General Intelligence in AI Systems',
|
|
@@ -56,12 +69,12 @@ def test_classify_paper_agi():
|
|
| 56 |
result = classifier.classify_paper(agi_paper)
|
| 57 |
|
| 58 |
assert result['agi_score'] >= 1
|
| 59 |
-
assert result['classification'] in ['
|
| 60 |
|
| 61 |
|
| 62 |
def test_classify_paper_asi():
|
| 63 |
"""Test classification of ASI paper"""
|
| 64 |
-
classifier =
|
| 65 |
|
| 66 |
asi_paper = {
|
| 67 |
'title': 'AI Safety and Alignment Problem',
|
|
@@ -72,12 +85,12 @@ def test_classify_paper_asi():
|
|
| 72 |
result = classifier.classify_paper(asi_paper)
|
| 73 |
|
| 74 |
assert result['asi_score'] >= 1
|
| 75 |
-
assert result['classification'] in ['
|
| 76 |
|
| 77 |
|
| 78 |
def test_classify_paper_not_related():
|
| 79 |
"""Test classification of non-related paper"""
|
| 80 |
-
classifier =
|
| 81 |
|
| 82 |
unrelated_paper = {
|
| 83 |
'title': 'Image Classification with CNNs',
|
|
@@ -87,16 +100,16 @@ def test_classify_paper_not_related():
|
|
| 87 |
|
| 88 |
result = classifier.classify_paper(unrelated_paper)
|
| 89 |
|
| 90 |
-
assert result['classification']
|
| 91 |
|
| 92 |
|
| 93 |
def test_batch_classify():
|
| 94 |
"""Test batch classification"""
|
| 95 |
-
classifier =
|
| 96 |
|
| 97 |
papers = [
|
| 98 |
{'title': 'AGI Paper', 'summary': 'About general intelligence', 'full_entry': 'AGI'},
|
| 99 |
-
{'title': '
|
| 100 |
]
|
| 101 |
|
| 102 |
results = classifier.batch_classify(papers)
|
|
@@ -107,29 +120,35 @@ def test_batch_classify():
|
|
| 107 |
|
| 108 |
def test_get_statistics():
|
| 109 |
"""Test statistics calculation"""
|
| 110 |
-
classifier =
|
| 111 |
|
| 112 |
classified_papers = [
|
| 113 |
-
{'classification_result': {'classification': 'AGI'}},
|
| 114 |
{'classification_result': {'classification': 'ASI'}},
|
|
|
|
| 115 |
{'classification_result': {'classification': 'ACI'}},
|
| 116 |
-
{'classification_result': {'classification': '
|
|
|
|
|
|
|
|
|
|
| 117 |
{'classification_result': {'classification': 'Not Related'}},
|
| 118 |
]
|
| 119 |
|
| 120 |
stats = classifier.get_statistics(classified_papers)
|
| 121 |
|
| 122 |
-
assert stats['total'] ==
|
| 123 |
assert stats['asi'] == 1
|
| 124 |
assert stats['agi'] == 1
|
| 125 |
assert stats['aci'] == 1
|
| 126 |
-
assert stats['
|
|
|
|
|
|
|
|
|
|
| 127 |
assert stats['not_related'] == 1
|
| 128 |
|
| 129 |
|
| 130 |
def test_get_statistics_empty():
|
| 131 |
"""Test statistics with empty list"""
|
| 132 |
-
classifier =
|
| 133 |
|
| 134 |
stats = classifier.get_statistics([])
|
| 135 |
|
|
@@ -137,5 +156,8 @@ def test_get_statistics_empty():
|
|
| 137 |
assert stats['asi'] == 0
|
| 138 |
assert stats['agi'] == 0
|
| 139 |
assert stats['aci'] == 0
|
| 140 |
-
assert stats['
|
|
|
|
|
|
|
|
|
|
| 141 |
assert stats['not_related'] == 0
|
|
|
|
| 3 |
"""
|
| 4 |
|
| 5 |
import pytest
|
| 6 |
+
from classifier import AIPapersIntelligenceClassifier
|
| 7 |
|
| 8 |
|
| 9 |
def test_classifier_initialization():
|
| 10 |
"""Test that classifier initializes correctly"""
|
| 11 |
+
classifier = AIPapersIntelligenceClassifier()
|
| 12 |
assert classifier.agi_keywords is not None
|
| 13 |
assert classifier.asi_keywords is not None
|
| 14 |
+
assert classifier.aci_keywords is not None
|
| 15 |
+
assert classifier.ani_keywords is not None
|
| 16 |
+
assert classifier.other_ai_keywords is not None
|
| 17 |
+
assert classifier.ml_keywords is not None
|
| 18 |
+
assert classifier.ds_keywords is not None
|
| 19 |
|
| 20 |
|
| 21 |
def test_classifier_with_semantic():
|
| 22 |
"""Test classifier with semantic analysis enabled"""
|
| 23 |
+
classifier = AIPapersIntelligenceClassifier(use_semantic=True, model_id="keyword")
|
| 24 |
assert classifier.use_semantic == True
|
| 25 |
assert classifier.model_id == "keyword"
|
| 26 |
|
| 27 |
|
| 28 |
def test_classify_paper():
|
| 29 |
"""Test paper classification"""
|
| 30 |
+
classifier = AIPapersIntelligenceClassifier()
|
| 31 |
|
| 32 |
test_paper = {
|
| 33 |
'title': 'Neural Computers: A New Computing Paradigm',
|
|
|
|
| 39 |
|
| 40 |
assert 'classification' in result
|
| 41 |
assert 'classification_reason' in result
|
|
|
|
| 42 |
assert 'asi_score' in result
|
| 43 |
+
assert 'agi_score' in result
|
| 44 |
+
assert 'aci_score' in result
|
| 45 |
+
assert 'ani_score' in result
|
| 46 |
+
assert 'other_ai_score' in result
|
| 47 |
+
assert 'ml_score' in result
|
| 48 |
+
assert 'ds_score' in result
|
| 49 |
assert 'combined_score' in result
|
| 50 |
assert 'matched_agi_keywords' in result
|
| 51 |
assert 'matched_asi_keywords' in result
|
| 52 |
+
assert 'matched_aci_keywords' in result
|
| 53 |
+
assert 'matched_ani_keywords' in result
|
| 54 |
+
assert 'matched_other_ai_keywords' in result
|
| 55 |
+
assert 'matched_ml_keywords' in result
|
| 56 |
+
assert 'matched_ds_keywords' in result
|
| 57 |
|
| 58 |
|
| 59 |
def test_classify_paper_agi():
|
| 60 |
"""Test classification of AGI paper"""
|
| 61 |
+
classifier = AIPapersIntelligenceClassifier()
|
| 62 |
|
| 63 |
agi_paper = {
|
| 64 |
'title': 'General Intelligence in AI Systems',
|
|
|
|
| 69 |
result = classifier.classify_paper(agi_paper)
|
| 70 |
|
| 71 |
assert result['agi_score'] >= 1
|
| 72 |
+
assert result['classification'] in ['ASI', 'AGI', 'ACI', 'ANI', 'Other AI', 'ML', 'DS']
|
| 73 |
|
| 74 |
|
| 75 |
def test_classify_paper_asi():
|
| 76 |
"""Test classification of ASI paper"""
|
| 77 |
+
classifier = AIPapersIntelligenceClassifier()
|
| 78 |
|
| 79 |
asi_paper = {
|
| 80 |
'title': 'AI Safety and Alignment Problem',
|
|
|
|
| 85 |
result = classifier.classify_paper(asi_paper)
|
| 86 |
|
| 87 |
assert result['asi_score'] >= 1
|
| 88 |
+
assert result['classification'] in ['ASI', 'AGI', 'ACI', 'ANI', 'Other AI', 'ML', 'DS']
|
| 89 |
|
| 90 |
|
| 91 |
def test_classify_paper_not_related():
|
| 92 |
"""Test classification of non-related paper"""
|
| 93 |
+
classifier = AIPapersIntelligenceClassifier()
|
| 94 |
|
| 95 |
unrelated_paper = {
|
| 96 |
'title': 'Image Classification with CNNs',
|
|
|
|
| 100 |
|
| 101 |
result = classifier.classify_paper(unrelated_paper)
|
| 102 |
|
| 103 |
+
assert result['classification'] in ['ASI', 'AGI', 'ACI', 'ANI', 'Other AI', 'ML', 'DS', 'Not Related']
|
| 104 |
|
| 105 |
|
| 106 |
def test_batch_classify():
|
| 107 |
"""Test batch classification"""
|
| 108 |
+
classifier = AIPapersIntelligenceClassifier()
|
| 109 |
|
| 110 |
papers = [
|
| 111 |
{'title': 'AGI Paper', 'summary': 'About general intelligence', 'full_entry': 'AGI'},
|
| 112 |
+
{'title': 'ML Paper', 'summary': 'About machine learning', 'full_entry': 'ML'},
|
| 113 |
]
|
| 114 |
|
| 115 |
results = classifier.batch_classify(papers)
|
|
|
|
| 120 |
|
| 121 |
def test_get_statistics():
|
| 122 |
"""Test statistics calculation"""
|
| 123 |
+
classifier = AIPapersIntelligenceClassifier()
|
| 124 |
|
| 125 |
classified_papers = [
|
|
|
|
| 126 |
{'classification_result': {'classification': 'ASI'}},
|
| 127 |
+
{'classification_result': {'classification': 'AGI'}},
|
| 128 |
{'classification_result': {'classification': 'ACI'}},
|
| 129 |
+
{'classification_result': {'classification': 'ANI'}},
|
| 130 |
+
{'classification_result': {'classification': 'Other AI'}},
|
| 131 |
+
{'classification_result': {'classification': 'ML'}},
|
| 132 |
+
{'classification_result': {'classification': 'DS'}},
|
| 133 |
{'classification_result': {'classification': 'Not Related'}},
|
| 134 |
]
|
| 135 |
|
| 136 |
stats = classifier.get_statistics(classified_papers)
|
| 137 |
|
| 138 |
+
assert stats['total'] == 8
|
| 139 |
assert stats['asi'] == 1
|
| 140 |
assert stats['agi'] == 1
|
| 141 |
assert stats['aci'] == 1
|
| 142 |
+
assert stats['ani'] == 1
|
| 143 |
+
assert stats['other_ai'] == 1
|
| 144 |
+
assert stats['ml'] == 1
|
| 145 |
+
assert stats['ds'] == 1
|
| 146 |
assert stats['not_related'] == 1
|
| 147 |
|
| 148 |
|
| 149 |
def test_get_statistics_empty():
|
| 150 |
"""Test statistics with empty list"""
|
| 151 |
+
classifier = AIPapersIntelligenceClassifier()
|
| 152 |
|
| 153 |
stats = classifier.get_statistics([])
|
| 154 |
|
|
|
|
| 156 |
assert stats['asi'] == 0
|
| 157 |
assert stats['agi'] == 0
|
| 158 |
assert stats['aci'] == 0
|
| 159 |
+
assert stats['ani'] == 0
|
| 160 |
+
assert stats['other_ai'] == 0
|
| 161 |
+
assert stats['ml'] == 0
|
| 162 |
+
assert stats['ds'] == 0
|
| 163 |
assert stats['not_related'] == 0
|
|
@@ -137,16 +137,25 @@ def test_filter_by_classification():
|
|
| 137 |
|
| 138 |
papers = [
|
| 139 |
{
|
| 140 |
-
'classification_result': {'classification': '
|
| 141 |
},
|
| 142 |
{
|
| 143 |
-
'classification_result': {'classification': '
|
| 144 |
},
|
| 145 |
{
|
| 146 |
'classification_result': {'classification': 'ACI'}
|
| 147 |
},
|
| 148 |
{
|
| 149 |
-
'classification_result': {'classification': '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
},
|
| 151 |
{
|
| 152 |
'classification_result': {'classification': 'Not Related'}
|
|
|
|
| 137 |
|
| 138 |
papers = [
|
| 139 |
{
|
| 140 |
+
'classification_result': {'classification': 'ASI'}
|
| 141 |
},
|
| 142 |
{
|
| 143 |
+
'classification_result': {'classification': 'AGI'}
|
| 144 |
},
|
| 145 |
{
|
| 146 |
'classification_result': {'classification': 'ACI'}
|
| 147 |
},
|
| 148 |
{
|
| 149 |
+
'classification_result': {'classification': 'ANI'}
|
| 150 |
+
},
|
| 151 |
+
{
|
| 152 |
+
'classification_result': {'classification': 'Other AI'}
|
| 153 |
+
},
|
| 154 |
+
{
|
| 155 |
+
'classification_result': {'classification': 'ML'}
|
| 156 |
+
},
|
| 157 |
+
{
|
| 158 |
+
'classification_result': {'classification': 'DS'}
|
| 159 |
},
|
| 160 |
{
|
| 161 |
'classification_result': {'classification': 'Not Related'}
|