Commit
·
df5beb9
1
Parent(s):
2a1016c
feat: add LLM label classification
Browse files- ai/ai.py +34 -0
- ai/classify_paper.py +382 -0
- css/table.css +2 -8
- fetch_paper.py +19 -4
- interface.py +14 -15
- parser.py +1 -0
ai/ai.py
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import requests
|
2 |
+
import json
|
3 |
+
import os
|
4 |
+
|
5 |
+
|
6 |
+
url = 'https://internlm-chat.intern-ai.org.cn/puyu/api/v1/chat/completions'
|
7 |
+
header = {
|
8 |
+
'Content-Type': 'application/json',
|
9 |
+
"Authorization": f"Bearer {os.environ['INTERNLM_API_KEY']}"
|
10 |
+
}
|
11 |
+
|
12 |
+
|
13 |
+
def complete(messages, model="internlm3-latest", temperature=None, top_p=None):
|
14 |
+
data = {
|
15 |
+
"model": model,
|
16 |
+
"messages": messages
|
17 |
+
}
|
18 |
+
if temperature is not None:
|
19 |
+
data["temperature"] = temperature
|
20 |
+
if top_p is not None:
|
21 |
+
data["top_p"] = top_p
|
22 |
+
|
23 |
+
res = requests.post(url, headers=header, data=json.dumps(data))
|
24 |
+
if res.status_code == 200:
|
25 |
+
return res.json()["choices"][0]['message']["content"]
|
26 |
+
else:
|
27 |
+
return None
|
28 |
+
|
29 |
+
|
30 |
+
if __name__ == "__main__":
|
31 |
+
response = complete(
|
32 |
+
messages=[{"role": "user", "content": "你好~"}]
|
33 |
+
)
|
34 |
+
print(response)
|
ai/classify_paper.py
ADDED
@@ -0,0 +1,382 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import time
|
2 |
+
from typing import List, Dict, Optional
|
3 |
+
from concurrent.futures import ThreadPoolExecutor, as_completed
|
4 |
+
from threading import Lock
|
5 |
+
from typing import List, Dict, Any
|
6 |
+
import json
|
7 |
+
|
8 |
+
try:
|
9 |
+
from .ai import complete
|
10 |
+
except ImportError:
|
11 |
+
from ai import complete
|
12 |
+
|
13 |
+
|
14 |
+
paper_types: Dict[str, str] = {
|
15 |
+
"CV": "computer vision, any paper that deals with image, video, point cloud or 3D model data",
|
16 |
+
"NLP": "natural language processing",
|
17 |
+
"LLM": "large language model, if a paper has this label, also include the NLP label",
|
18 |
+
"RO": "robotics",
|
19 |
+
"ML": "machine learning, use this label only when the paper is not specific to any of the above categories",
|
20 |
+
}
|
21 |
+
|
22 |
+
type_sort_order = ["ML", "CV", "NLP", "LLM", "RO"]
|
23 |
+
|
24 |
+
system_prompt = """
|
25 |
+
You are a professional AI researcher. You are helping users to organize their papers.
|
26 |
+
""".strip()
|
27 |
+
|
28 |
+
user_prompt = "\n\n".join([
|
29 |
+
"""
|
30 |
+
You are given a list of papers. You need to classify each paper into one of the following categories:
|
31 |
+
""".strip(),
|
32 |
+
|
33 |
+
chr(10).join(map(lambda x: f"- {x}: {paper_types[x]}", paper_types.keys())),
|
34 |
+
|
35 |
+
"""
|
36 |
+
You will be given several papers at a time. For each paper, you need to classify it into one of the categories above.
|
37 |
+
|
38 |
+
You should output in the following format with a code block:
|
39 |
+
""".strip(),
|
40 |
+
"""
|
41 |
+
```json
|
42 |
+
[
|
43 |
+
{
|
44 |
+
"index": 1,
|
45 |
+
"category": ["RO"]
|
46 |
+
},
|
47 |
+
{
|
48 |
+
"index": 2,
|
49 |
+
"category": ["ML"]
|
50 |
+
},
|
51 |
+
{
|
52 |
+
"index": 3,
|
53 |
+
"category": ["LLM", "NLP"]
|
54 |
+
}
|
55 |
+
]
|
56 |
+
```
|
57 |
+
""".strip(),
|
58 |
+
"""
|
59 |
+
The followings are the papers you need to classify:
|
60 |
+
"""
|
61 |
+
])
|
62 |
+
|
63 |
+
|
64 |
+
def build_paper(index: int, title: str, abstract: str = None) -> str:
|
65 |
+
|
66 |
+
if abstract is None:
|
67 |
+
return f"{index}. {title}"
|
68 |
+
|
69 |
+
return f"{index}. {title}\n\n{abstract}"
|
70 |
+
|
71 |
+
|
72 |
+
def get_classify_prompt(papers: List[Dict[str, str]]) -> str:
|
73 |
+
prompt = []
|
74 |
+
|
75 |
+
for index, paper in enumerate(papers, start=1):
|
76 |
+
prompt.append(build_paper(paper["index"] if "index" in paper else index, paper["title"], paper["abstract"] if "abstract" in paper else None))
|
77 |
+
|
78 |
+
return user_prompt + "\n\n" + "\n\n".join(prompt)
|
79 |
+
|
80 |
+
|
81 |
+
def parse_response(response: str) -> List[Dict[str, List[str]]] | None:
|
82 |
+
# 匹配code block
|
83 |
+
response = response.strip()
|
84 |
+
if not response.startswith("```") or not response.endswith("```"):
|
85 |
+
return None
|
86 |
+
|
87 |
+
# 删除response的第一行和最后一行
|
88 |
+
response = "\n".join(response.split("\n")[1:-1])
|
89 |
+
|
90 |
+
try:
|
91 |
+
data = json.loads(response)
|
92 |
+
except json.JSONDecodeError:
|
93 |
+
return None
|
94 |
+
|
95 |
+
for paper in data:
|
96 |
+
if "index" not in paper or "category" not in paper:
|
97 |
+
return None
|
98 |
+
|
99 |
+
if not isinstance(paper["index"], int) or not isinstance(paper["category"], list):
|
100 |
+
return None
|
101 |
+
|
102 |
+
for category in paper["category"]:
|
103 |
+
if category not in paper_types:
|
104 |
+
return None
|
105 |
+
|
106 |
+
# sort the categories
|
107 |
+
for paper in data:
|
108 |
+
if "LLM" in paper["category"] and "NLP" not in paper["category"]:
|
109 |
+
paper["category"].append("NLP")
|
110 |
+
|
111 |
+
# sort the categories
|
112 |
+
for paper in data:
|
113 |
+
paper["category"].sort(key=lambda x: type_sort_order.index(x))
|
114 |
+
|
115 |
+
return data
|
116 |
+
|
117 |
+
|
118 |
+
def get_classification(papers: List[Dict[str, str]]) -> List[Dict[str, List[str]]] | None:
|
119 |
+
prompt = get_classify_prompt(papers)
|
120 |
+
|
121 |
+
for _ in range(3):
|
122 |
+
try:
|
123 |
+
print("Request sent")
|
124 |
+
response = complete([{"role": "system", "content": system_prompt}, {"role": "user", "content": prompt}])
|
125 |
+
|
126 |
+
if response is not None:
|
127 |
+
return parse_response(response)
|
128 |
+
except:
|
129 |
+
pass
|
130 |
+
|
131 |
+
|
132 |
+
class TokenBucket:
|
133 |
+
def __init__(self):
|
134 |
+
self.tokens = 200
|
135 |
+
self.last_update = time.time()
|
136 |
+
self.lock = Lock()
|
137 |
+
|
138 |
+
def acquire(self, n: int) -> bool:
|
139 |
+
with self.lock:
|
140 |
+
current_time = time.time()
|
141 |
+
elapsed = current_time - self.last_update
|
142 |
+
if elapsed >= 60:
|
143 |
+
added_tokens = int(elapsed // 60) * 200
|
144 |
+
self.tokens = min(self.tokens + added_tokens, 200)
|
145 |
+
self.last_update += 60 * (elapsed // 60)
|
146 |
+
if self.tokens >= n:
|
147 |
+
self.tokens -= n
|
148 |
+
return True
|
149 |
+
return False
|
150 |
+
|
151 |
+
|
152 |
+
token_bucket = TokenBucket()
|
153 |
+
|
154 |
+
|
155 |
+
class PaperCache:
|
156 |
+
def __init__(self):
|
157 |
+
self.cache = {}
|
158 |
+
self.lock = Lock()
|
159 |
+
|
160 |
+
def get(self, paper):
|
161 |
+
key = (paper['title'], paper.get('abstract'))
|
162 |
+
with self.lock:
|
163 |
+
return self.cache.get(key)
|
164 |
+
|
165 |
+
def set(self, paper, result):
|
166 |
+
key = (paper['title'], paper.get('abstract'))
|
167 |
+
with self.lock:
|
168 |
+
self.cache[key] = result
|
169 |
+
|
170 |
+
|
171 |
+
paper_cache = PaperCache()
|
172 |
+
|
173 |
+
|
174 |
+
def classify_papers(papers: List[Dict[str, str]]) -> Optional[List[Dict[str, List[str]]]]:
|
175 |
+
print(f"Classifying {len(papers)} papers")
|
176 |
+
|
177 |
+
cached_results = []
|
178 |
+
uncached_papers = []
|
179 |
+
|
180 |
+
# 为 papers 添加index
|
181 |
+
for index, paper in enumerate(papers, start=1):
|
182 |
+
paper['index'] = index
|
183 |
+
|
184 |
+
for paper in papers:
|
185 |
+
cached_result = paper_cache.get(paper)
|
186 |
+
if cached_result is not None:
|
187 |
+
cached_results.append(cached_result)
|
188 |
+
else:
|
189 |
+
uncached_papers.append(paper)
|
190 |
+
|
191 |
+
if not uncached_papers:
|
192 |
+
return cached_results
|
193 |
+
|
194 |
+
batches = [uncached_papers[i:i+10] for i in range(0, len(uncached_papers), 10)]
|
195 |
+
num_batches = len(batches)
|
196 |
+
if num_batches == 0:
|
197 |
+
return cached_results
|
198 |
+
|
199 |
+
if not token_bucket.acquire(num_batches):
|
200 |
+
return None
|
201 |
+
|
202 |
+
try:
|
203 |
+
with ThreadPoolExecutor(max_workers=10) as executor:
|
204 |
+
futures = [executor.submit(get_classification, batch) for batch in batches]
|
205 |
+
results = []
|
206 |
+
for future in as_completed(futures):
|
207 |
+
batch_result = future.result()
|
208 |
+
if batch_result is None:
|
209 |
+
for f in futures:
|
210 |
+
f.cancel()
|
211 |
+
return None
|
212 |
+
for paper, result in zip(uncached_papers, batch_result):
|
213 |
+
paper_cache.set(paper, result)
|
214 |
+
results.extend(batch_result)
|
215 |
+
results.sort(key=lambda x: x['index'])
|
216 |
+
return cached_results + results
|
217 |
+
except Exception:
|
218 |
+
return None
|
219 |
+
|
220 |
+
|
221 |
+
if __name__ == "__main__":
|
222 |
+
from rich import print
|
223 |
+
import time
|
224 |
+
|
225 |
+
start = time.time()
|
226 |
+
|
227 |
+
print(classify_papers([
|
228 |
+
{
|
229 |
+
"title": "OmniHuman-1: Rethinking the Scaling-Up of One-Stage Conditioned Human Animation Models",
|
230 |
+
"abstract": "End-to-end human animation, such as audio-driven talking human generation, has undergone notable advancements in the recent few years. However, existing methods still struggle to scale up as large general video generation models, limiting their potential in real applications. In this paper, we propose OmniHuman, a Diffusion Transformer-based framework that scales up data by mixing motion-related conditions into the training phase. To this end, we introduce two training principles for these mixed conditions, along with the corresponding model architecture and inference strategy. These designs enable OmniHuman to fully leverage data-driven motion generation, ultimately achieving highly realistic human video generation. More importantly, OmniHuman supports various portrait contents (face close-up, portrait, half-body, full-body), supports both talking and singing, handles human-object interactions and challenging body poses, and accommodates different image styles. Compared to existing end-to-end audio-driven methods, OmniHuman not only produces more realistic videos, but also offers greater flexibility in inputs. It also supports multiple driving modalities (audio-driven, video-driven and combined driving signals). Video samples are provided on the ttfamily project page (https://omnihuman-lab.github.io)"
|
231 |
+
},
|
232 |
+
{
|
233 |
+
"title": "SmolLM2: When Smol Goes Big -- Data-Centric Training of a Small Language Model",
|
234 |
+
"abstract": "While large language models have facilitated breakthroughs in many applications of artificial intelligence, their inherent largeness makes them computationally expensive and challenging to deploy in resource-constrained settings. In this paper, we document the development of SmolLM2, a state-of-the-art \"small\" (1.7 billion parameter) language model (LM). To attain strong performance, we overtrain SmolLM2 on ~11 trillion tokens of data using a multi-stage training process that mixes web text with specialized math, code, and instruction-following data. We additionally introduce new specialized datasets (FineMath, Stack-Edu, and SmolTalk) at stages where we found existing datasets to be problematically small or low-quality. To inform our design decisions, we perform both small-scale ablations as well as a manual refinement process that updates the dataset mixing rates at each stage based on the performance at the previous stage. Ultimately, we demonstrate that SmolLM2 outperforms other recent small LMs including Qwen2.5-1.5B and Llama3.2-1B. To facilitate future research on LM development as well as applications of small LMs, we release both SmolLM2 as well as all of the datasets we prepared in the course of this project."
|
235 |
+
},
|
236 |
+
{
|
237 |
+
"title": "Generating Multi-Image Synthetic Data for Text-to-Image Customization",
|
238 |
+
"abstract": "Customization of text-to-image models enables users to insert custom concepts and generate the concepts in unseen settings. Existing methods either rely on costly test-time optimization or train encoders on single-image training datasets without multi-image supervision, leading to worse image quality. We propose a simple approach that addresses both limitations. We first leverage existing text-to-image models and 3D datasets to create a high-quality Synthetic Customization Dataset (SynCD) consisting of multiple images of the same object in different lighting, backgrounds, and poses. We then propose a new encoder architecture based on shared attention mechanisms that better incorporate fine-grained visual details from input images. Finally, we propose a new inference technique that mitigates overexposure issues during inference by normalizing the text and image guidance vectors. Through extensive experiments, we show that our model, trained on the synthetic dataset with the proposed encoder and inference algorithm, outperforms existing tuning-free methods on standard customization benchmarks.",
|
239 |
+
},
|
240 |
+
{'title': 's1: Simple test-time scaling'},
|
241 |
+
{'title': 'Reward-Guided Speculative Decoding for Efficient LLM Reasoning'},
|
242 |
+
{'title': 'MatAnyone: Stable Video Matting with Consistent Memory Propagation'},
|
243 |
+
{'title': 'Self-supervised Quantized Representation for Seamlessly Integrating Knowledge Graphs with Large Language Models'},
|
244 |
+
{'title': 'Scalable-Softmax Is Superior for Attention'},
|
245 |
+
{'title': 'PixelWorld: Towards Perceiving Everything as Pixels'},
|
246 |
+
{'title': 'DINO-WM: World Models on Pre-trained Visual Features enable Zero-shot Planning'},
|
247 |
+
{'title': 'Constitutional Classifiers: Defending against Universal Jailbreaks across Thousands of Hours of Red Teaming'},
|
248 |
+
{'title': 'SAeUron: Interpretable Concept Unlearning in Diffusion Models with Sparse Autoencoders'},
|
249 |
+
{'title': 'Zero-Shot Novel View and Depth Synthesis with Multi-View Geometric Diffusion'},
|
250 |
+
{'title': 'The Surprising Agreement Between Convex Optimization Theory and Learning-Rate Scheduling for Large Model Training'},
|
251 |
+
{'title': 'Fast Encoder-Based 3D from Casual Videos via Point Track Processing'},
|
252 |
+
{'title': 'Unraveling the Capabilities of Language Models in News Summarization'},
|
253 |
+
{'title': 'Trading Inference-Time Compute for Adversarial Robustness'},
|
254 |
+
{'title': 'INT: Instance-Specific Negative Mining for Task-Generic Promptable Segmentation'},
|
255 |
+
{'title': 'ChunkKV: Semantic-Preserving KV Cache Compression for Efficient Long-Context LLM Inference'},
|
256 |
+
{'title': 'VideoJAM: Joint Appearance-Motion Representations for Enhanced Motion Generation in Video Models'},
|
257 |
+
{'title': 'Inverse Bridge Matching Distillation'},
|
258 |
+
{'title': 'ACECODER: Acing Coder RL via Automated Test-Case Synthesis'},
|
259 |
+
{'title': 'Satori: Reinforcement Learning with Chain-of-Action-Thought Enhances LLM Reasoning via Autoregressive Search'},
|
260 |
+
{'title': 'QLASS: Boosting Language Agent Inference via Q-Guided Stepwise Search'},
|
261 |
+
{'title': 'Concept Steerers: Leveraging K-Sparse Autoencoders for Controllable Generations'},
|
262 |
+
{'title': 'Can LLMs Maintain Fundamental Abilities under KV Cache Compression?'},
|
263 |
+
{'title': 'Rethinking Mixture-of-Agents: Is Mixing Different Large Language Models Beneficial?'},
|
264 |
+
{'title': 'COCONut-PanCap: Joint Panoptic Segmentation and Grounded Captions for Fine-Grained Understanding and Generation'},
|
265 |
+
{'title': 'Text-to-CAD Generation Through Infusing Visual Feedback in Large Language Models'},
|
266 |
+
{'title': 'Generating Multi-Image Synthetic Data for Text-to-Image Customization'},
|
267 |
+
{'title': 'Sample, Scrutinize and Scale: Effective Inference-Time Search by Scaling Verification'},
|
268 |
+
{'title': 'Federated Sketching LoRA: On-Device Collaborative Fine-Tuning of Large Language Models'},
|
269 |
+
{'title': 'Activation Approximations Can Incur Safety Vulnerabilities Even in Aligned LLMs: Comprehensive Analysis and Defense'},
|
270 |
+
{'title': 'SmolLM2: When Smol Goes Big -- Data-Centric Training of a Small Language Model'},
|
271 |
+
{'title': 'Demystifying Long Chain-of-Thought Reasoning in LLMs'},
|
272 |
+
{'title': 'LIMO: Less is More for Reasoning'},
|
273 |
+
{'title': 'TwinMarket: A Scalable Behavioral and Social Simulation for Financial Markets'},
|
274 |
+
{'title': 'LayerTracer: Cognitive-Aligned Layered SVG Synthesis via Diffusion Transformer'},
|
275 |
+
{'title': 'Boosting Multimodal Reasoning with MCTS-Automated Structured Thinking'},
|
276 |
+
{'title': 'Token Assorted: Mixing Latent and Text Tokens for Improved Language Model Reasoning'},
|
277 |
+
{'title': 'Large Language Model Guided Self-Debugging Code Generation'},
|
278 |
+
{'title': 'Jailbreaking with Universal Multi-Prompts'},
|
279 |
+
{'title': 'A Probabilistic Inference Approach to Inference-Time Scaling of LLMs using Particle-Based Monte Carlo Methods'},
|
280 |
+
{'title': 'On Teacher Hacking in Language Model Distillation'},
|
281 |
+
{'title': 'Riddle Me This! Stealthy Membership Inference for Retrieval-Augmented Generation'},
|
282 |
+
{'title': 'Activation-Informed Merging of Large Language Models'},
|
283 |
+
{'title': 'HackerRank-ASTRA: Evaluating Correctness & Consistency of Large Language Models on cross-domain multi-file project problems'},
|
284 |
+
{'title': 'Analyze Feature Flow to Enhance Interpretation and Steering in Language Models'},
|
285 |
+
{'title': 'Gold-medalist Performance in Solving Olympiad Geometry with AlphaGeometry2'},
|
286 |
+
{'title': 'DynVFX: Augmenting Real Videos with Dynamic Content'},
|
287 |
+
{'title': 'UltraIF: Advancing Instruction Following from the Wild'},
|
288 |
+
{'title': 'Great Models Think Alike and this Undermines AI Oversight'},
|
289 |
+
{'title': 'ConceptAttention: Diffusion Transformers Learn Highly Interpretable Features'},
|
290 |
+
{'title': 'Ola: Pushing the Frontiers of Omni-Modal Language Model with Progressive Modality Alignment'},
|
291 |
+
{'title': 'Weak-to-Strong Diffusion with Reflection'},
|
292 |
+
{'title': 'MAGA: MAssive Genre-Audience Reformulation to Pretraining Corpus Expansion'},
|
293 |
+
{'title': 'MotionLab: Unified Human Motion Generation and Editing via the Motion-Condition-Motion Paradigm'},
|
294 |
+
{'title': 'BOLT: Bootstrap Long Chain-of-Thought in Language Models without Distillation'},
|
295 |
+
{'title': 'ScoreFlow: Mastering LLM Agent Workflows via Score-based Preference Optimization'},
|
296 |
+
{'title': 'Llasa: Scaling Train-Time and Inference-Time Compute for Llama-based Speech Synthesis'},
|
297 |
+
{'title': 'MotionCanvas: Cinematic Shot Design with Controllable Image-to-Video Generation'},
|
298 |
+
{'title': 'PILAF: Optimal Human Preference Sampling for Reward Modeling'},
|
299 |
+
{'title': 'Beyond Prompt Content: Enhancing LLM Performance via Content-Format Integrated Prompt Optimization'},
|
300 |
+
{'title': 'ChartCitor: Multi-Agent Framework for Fine-Grained Chart Visual Attribution'},
|
301 |
+
{'title': 'Towards Physical Understanding in Video Generation: A 3D Point Regularization Approach'},
|
302 |
+
{'title': 'PlotGen: Multi-Agent LLM-based Scientific Data Visualization via Multimodal Feedback'},
|
303 |
+
{'title': 'Enhancing Code Generation for Low-Resource Languages: No Silver Bullet'},
|
304 |
+
{'title': 'Learning Real-World Action-Video Dynamics with Heterogeneous Masked Autoregression'},
|
305 |
+
{'title': 'Speak Easy: Eliciting Harmful Jailbreaks from LLMs with Simple Interactions'},
|
306 |
+
{'title': 'OmniHuman-1: Rethinking the Scaling-Up of One-Stage Conditioned Human Animation Models'},
|
307 |
+
{'title': 'The Differences Between Direct Alignment Algorithms are a Blur'},
|
308 |
+
{'title': 'Process Reinforcement through Implicit Rewards'},
|
309 |
+
{'title': 'Preference Leakage: A Contamination Problem in LLM-as-a-judge'},
|
310 |
+
{'title': 'AlignVLM: Bridging Vision and Language Latent Spaces for Multimodal Understanding'},
|
311 |
+
{'title': 'SafeRAG: Benchmarking Security in Retrieval-Augmented Generation of Large Language Model'},
|
312 |
+
{'title': 'SliderSpace: Decomposing the Visual Capabilities of Diffusion Models'},
|
313 |
+
]))
|
314 |
+
|
315 |
+
print(classify_papers([
|
316 |
+
{'title': 'Federated Sketching LoRA: On-Device Collaborative Fine-Tuning of Large Language Models'},
|
317 |
+
{'title': 'Activation Approximations Can Incur Safety Vulnerabilities Even in Aligned LLMs: Comprehensive Analysis and Defense'},
|
318 |
+
{'title': 'SmolLM2: When Smol Goes Big -- Data-Centric Training of a Small Language Model'},
|
319 |
+
{'title': 'Demystifying Long Chain-of-Thought Reasoning in LLMs'},
|
320 |
+
{'title': 'LIMO: Less is More for Reasoning'},
|
321 |
+
{'title': 'TwinMarket: A Scalable Behavioral and Social Simulation for Financial Markets'},
|
322 |
+
{'title': 'LayerTracer: Cognitive-Aligned Layered SVG Synthesis via Diffusion Transformer'},
|
323 |
+
{'title': 'Boosting Multimodal Reasoning with MCTS-Automated Structured Thinking'},
|
324 |
+
{'title': 'Token Assorted: Mixing Latent and Text Tokens for Improved Language Model Reasoning'},
|
325 |
+
{'title': 'Large Language Model Guided Self-Debugging Code Generation'},
|
326 |
+
{'title': 'Jailbreaking with Universal Multi-Prompts'},
|
327 |
+
{'title': 'A Probabilistic Inference Approach to Inference-Time Scaling of LLMs using Particle-Based Monte Carlo Methods'},
|
328 |
+
{'title': 'On Teacher Hacking in Language Model Distillation'},
|
329 |
+
{'title': 'Riddle Me This! Stealthy Membership Inference for Retrieval-Augmented Generation'},
|
330 |
+
{'title': 'Activation-Informed Merging of Large Language Models'},
|
331 |
+
{'title': 'HackerRank-ASTRA: Evaluating Correctness & Consistency of Large Language Models on cross-domain multi-file project problems'},
|
332 |
+
{'title': 'Analyze Feature Flow to Enhance Interpretation and Steering in Language Models'},
|
333 |
+
{'title': 'Gold-medalist Performance in Solving Olympiad Geometry with AlphaGeometry2'},
|
334 |
+
{'title': 'DynVFX: Augmenting Real Videos with Dynamic Content'},
|
335 |
+
{'title': 'UltraIF: Advancing Instruction Following from the Wild'},
|
336 |
+
{'title': 'Great Models Think Alike and this Undermines AI Oversight'},
|
337 |
+
{'title': 'ConceptAttention: Diffusion Transformers Learn Highly Interpretable Features'},
|
338 |
+
{'title': 'Ola: Pushing the Frontiers of Omni-Modal Language Model with Progressive Modality Alignment'},
|
339 |
+
{'title': 'Weak-to-Strong Diffusion with Reflection'},
|
340 |
+
{'title': 'MAGA: MAssive Genre-Audience Reformulation to Pretraining Corpus Expansion'},
|
341 |
+
{'title': 'MotionLab: Unified Human Motion Generation and Editing via the Motion-Condition-Motion Paradigm'},
|
342 |
+
{'title': 'BOLT: Bootstrap Long Chain-of-Thought in Language Models without Distillation'},
|
343 |
+
{'title': 'ScoreFlow: Mastering LLM Agent Workflows via Score-based Preference Optimization'},
|
344 |
+
{'title': 'Llasa: Scaling Train-Time and Inference-Time Compute for Llama-based Speech Synthesis'},
|
345 |
+
{'title': 'MotionCanvas: Cinematic Shot Design with Controllable Image-to-Video Generation'},
|
346 |
+
{'title': 'PILAF: Optimal Human Preference Sampling for Reward Modeling'},
|
347 |
+
{'title': 'Beyond Prompt Content: Enhancing LLM Performance via Content-Format Integrated Prompt Optimization'},
|
348 |
+
{'title': 'ChartCitor: Multi-Agent Framework for Fine-Grained Chart Visual Attribution'},
|
349 |
+
{'title': 'Towards Physical Understanding in Video Generation: A 3D Point Regularization Approach'},
|
350 |
+
{'title': 'PlotGen: Multi-Agent LLM-based Scientific Data Visualization via Multimodal Feedback'},
|
351 |
+
{'title': 'Enhancing Code Generation for Low-Resource Languages: No Silver Bullet'},
|
352 |
+
{'title': 'Learning Real-World Action-Video Dynamics with Heterogeneous Masked Autoregression'},
|
353 |
+
{'title': 'Speak Easy: Eliciting Harmful Jailbreaks from LLMs with Simple Interactions'},
|
354 |
+
{'title': 'OmniHuman-1: Rethinking the Scaling-Up of One-Stage Conditioned Human Animation Models'},
|
355 |
+
{'title': 'The Differences Between Direct Alignment Algorithms are a Blur'},
|
356 |
+
{'title': 'Process Reinforcement through Implicit Rewards'},
|
357 |
+
{'title': 'Preference Leakage: A Contamination Problem in LLM-as-a-judge'},
|
358 |
+
{'title': 'AlignVLM: Bridging Vision and Language Latent Spaces for Multimodal Understanding'},
|
359 |
+
{'title': 'SafeRAG: Benchmarking Security in Retrieval-Augmented Generation of Large Language Model'},
|
360 |
+
{'title': 'SliderSpace: Decomposing the Visual Capabilities of Diffusion Models'},
|
361 |
+
{'title': 'MM-IQ: Benchmarking Human-Like Abstraction and Reasoning in Multimodal Models'},
|
362 |
+
{'title': 'DeepRAG: Thinking to Retrieval Step by Step for Large Language Models'},
|
363 |
+
{'title': 'Scaling Embedding Layers in Language Models'},
|
364 |
+
{'title': 'MakeAnything: Harnessing Diffusion Transformers for Multi-Domain Procedural Sequence Generation'},
|
365 |
+
{'title': 'AIN: The Arabic INclusive Large Multimodal Model'},
|
366 |
+
{'title': 'FastKV: KV Cache Compression for Fast Long-Context Processing with Token-Selective Propagation'},
|
367 |
+
{'title': 'ZebraLogic: On the Scaling Limits of LLMs for Logical Reasoning'},
|
368 |
+
{'title': 'The Jumping Reasoning Curve? Tracking the Evolution of Reasoning Performance in GPT-[n] and o-[n] Models on Multimodal Puzzles'},
|
369 |
+
{'title': 'RandLoRA: Full-rank parameter-efficient fine-tuning of large models'},
|
370 |
+
{'title': 'Almost Surely Safe Alignment of Large Language Models at Inference-Time'},
|
371 |
+
{'title': 'Improving Transformer World Models for Data-Efficient RL'},
|
372 |
+
{'title': 'PhD Knowledge Not Required: A Reasoning Challenge for Large Language Models'},
|
373 |
+
{'title': 'Improved Training Technique for Latent Consistency Models'},
|
374 |
+
{'title': 'LongDPO: Unlock Better Long-form Generation Abilities for LLMs via Critique-augmented Stepwise Information'},
|
375 |
+
{'title': 'Learning to Generate Unit Tests for Automated Debugging'},
|
376 |
+
{'title': 'Lifelong Sequential Knowledge Editing without Model Degradation'},
|
377 |
+
{'title': 'A Study on the Performance of U-Net Modifications in Retroperitoneal Tumor Segmentation'},
|
378 |
+
{'title': 'Language Models Prefer What They Know: Relative Confidence Estimation via Confidence Preferences'},
|
379 |
+
{'title': 'Current Pathology Foundation Models are unrobust to Medical Center Differences'}
|
380 |
+
]))
|
381 |
+
|
382 |
+
print(f"Time taken: {time.time() - start}")
|
css/table.css
CHANGED
@@ -31,16 +31,10 @@
|
|
31 |
text-decoration: underline !important;
|
32 |
}
|
33 |
|
34 |
-
.paper-table td:
|
35 |
-
.paper-table td:nth-child(3),
|
36 |
-
.paper-table td:nth-child(4),
|
37 |
-
.paper-table td:nth-child(5) {
|
38 |
text-align: center;
|
39 |
}
|
40 |
|
41 |
-
.paper-table th:
|
42 |
-
.paper-table th:nth-child(3),
|
43 |
-
.paper-table th:nth-child(4),
|
44 |
-
.paper-table th:nth-child(5) {
|
45 |
text-align: center;
|
46 |
}
|
|
|
31 |
text-decoration: underline !important;
|
32 |
}
|
33 |
|
34 |
+
.paper-table td:not(:first-child) {
|
|
|
|
|
|
|
35 |
text-align: center;
|
36 |
}
|
37 |
|
38 |
+
.paper-table th:not(:first-child) {
|
|
|
|
|
|
|
39 |
text-align: center;
|
40 |
}
|
fetch_paper.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
-
from parser import parse_article
|
|
|
2 |
import os
|
3 |
import requests
|
4 |
import datetime
|
@@ -8,6 +9,8 @@ from rich import print
|
|
8 |
from date import Date
|
9 |
from concurrent.futures import ThreadPoolExecutor, as_completed
|
10 |
|
|
|
|
|
11 |
|
12 |
API_URL = "https://huggingface.co/api/daily_papers"
|
13 |
|
@@ -63,7 +66,7 @@ def fetch_papers_with_date(date: datetime):
|
|
63 |
|
64 |
|
65 |
def fetch_papers_with_daterange(start_date: Date, end_date: Date):
|
66 |
-
articles = []
|
67 |
current_date = start_date
|
68 |
dates = []
|
69 |
|
@@ -91,14 +94,26 @@ def fetch_papers_with_daterange(start_date: Date, end_date: Date):
|
|
91 |
|
92 |
# articles = [article for article in articles if (start_date <= Date(article.publishedAt.isoformat().split('T')[0]) <= end_date)]
|
93 |
|
94 |
-
unique_articles = {}
|
95 |
for article in articles:
|
96 |
if article.paper.id not in unique_articles:
|
97 |
unique_articles[article.paper.id] = article
|
98 |
|
99 |
print(f"Unique articles: {len(unique_articles)}")
|
100 |
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
|
104 |
if __name__ == "__main__":
|
|
|
1 |
+
from parser import parse_article, Article
|
2 |
+
from ai.classify_paper import classify_papers
|
3 |
import os
|
4 |
import requests
|
5 |
import datetime
|
|
|
9 |
from date import Date
|
10 |
from concurrent.futures import ThreadPoolExecutor, as_completed
|
11 |
|
12 |
+
from typing import List, Dict
|
13 |
+
|
14 |
|
15 |
API_URL = "https://huggingface.co/api/daily_papers"
|
16 |
|
|
|
66 |
|
67 |
|
68 |
def fetch_papers_with_daterange(start_date: Date, end_date: Date):
|
69 |
+
articles: List[Article] = []
|
70 |
current_date = start_date
|
71 |
dates = []
|
72 |
|
|
|
94 |
|
95 |
# articles = [article for article in articles if (start_date <= Date(article.publishedAt.isoformat().split('T')[0]) <= end_date)]
|
96 |
|
97 |
+
unique_articles: Dict[str, Article] = {}
|
98 |
for article in articles:
|
99 |
if article.paper.id not in unique_articles:
|
100 |
unique_articles[article.paper.id] = article
|
101 |
|
102 |
print(f"Unique articles: {len(unique_articles)}")
|
103 |
|
104 |
+
unique_articles: List[Article] = list(unique_articles.values())
|
105 |
+
|
106 |
+
preprocessed_articles = list(map(lambda article: {
|
107 |
+
"title": article.title,
|
108 |
+
"abstract": article.paper.summary,
|
109 |
+
}, unique_articles))
|
110 |
+
|
111 |
+
classified_articles = classify_papers(preprocessed_articles)
|
112 |
+
|
113 |
+
for i, article in enumerate(unique_articles):
|
114 |
+
article.paper.label = classified_articles[i]["category"]
|
115 |
+
|
116 |
+
return unique_articles
|
117 |
|
118 |
|
119 |
if __name__ == "__main__":
|
interface.py
CHANGED
@@ -17,6 +17,7 @@ def format_author(author):
|
|
17 |
return "Anonymous author"
|
18 |
|
19 |
|
|
|
20 |
def format_paper_info(article):
|
21 |
"""Generate HTML content for paper display"""
|
22 |
if not article.paper:
|
@@ -77,6 +78,7 @@ def generate_table_html(papers):
|
|
77 |
'<th>👍 Upvotes</th>'
|
78 |
'<th>💬 Comments</th>'
|
79 |
'<th>📅 Date</th>'
|
|
|
80 |
'<th></th>'
|
81 |
'</tr></thead><tbody>']
|
82 |
|
@@ -86,6 +88,7 @@ def generate_table_html(papers):
|
|
86 |
comments = article.numComments or 0
|
87 |
date = article.paper.publishedAt.strftime("%Y-%m-%d") if article.paper.publishedAt else "Unknown"
|
88 |
paper_id = article.paper.id
|
|
|
89 |
|
90 |
# 构造 arXiv abs 链接
|
91 |
arxiv_abs_link = f"https://huggingface.co/papers/{paper_id}"
|
@@ -96,6 +99,7 @@ def generate_table_html(papers):
|
|
96 |
<td>{upvotes}</td>
|
97 |
<td>{comments}</td>
|
98 |
<td>{date}</td>
|
|
|
99 |
<td><a href="javascript:void(0)" onclick="showDetail('{paper_id}')" class="sf-button" style="margin: 0">Details{assets.SVG_LINK}</a></td>
|
100 |
</tr>
|
101 |
"""
|
@@ -134,6 +138,8 @@ def query_papers(start_date_str: str, end_date_str: str, sort_method: str): # A
|
|
134 |
papers = sort_by_date(papers, reverse=False)
|
135 |
elif sort_method == "Sort by date descending":
|
136 |
papers = sort_by_date(papers, reverse=True)
|
|
|
|
|
137 |
|
138 |
return generate_table_html(papers), build_html(papers)
|
139 |
except Exception as e:
|
@@ -141,14 +147,6 @@ def query_papers(start_date_str: str, end_date_str: str, sort_method: str): # A
|
|
141 |
return "<p>⚠️ Query failed, please check the date format (YYYY-MM-DD)</p>", "<p>⚠️ Query failed, please check the date format (YYYY-MM-DD)</p>"
|
142 |
|
143 |
|
144 |
-
def show_detail(paper_id, papers):
|
145 |
-
"""Show paper details"""
|
146 |
-
if not papers:
|
147 |
-
return "Please perform a query first"
|
148 |
-
|
149 |
-
return build_html(papers)
|
150 |
-
|
151 |
-
|
152 |
# CSS 样式(可放入单独文件)
|
153 |
custom_css = """
|
154 |
.detail-area { margin-top: 20px; padding: 20px; border: 1px solid #ddd; border-radius: 5px; }
|
@@ -194,13 +192,13 @@ def create_interface():
|
|
194 |
# Main interface
|
195 |
gr.HTML("<div style='text-align: center'><h1>📚 Hugging Face Weekly Paper</h1></div>")
|
196 |
gr.HTML("""<div style='text-align: center'>
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
|
205 |
# Query control area
|
206 |
with gr.Row():
|
@@ -228,6 +226,7 @@ def create_interface():
|
|
228 |
"Sort by upvotes ascending",
|
229 |
"Sort by comments ascending",
|
230 |
"Sort by date ascending",
|
|
|
231 |
],
|
232 |
value="Sort by upvotes descending",
|
233 |
)
|
|
|
17 |
return "Anonymous author"
|
18 |
|
19 |
|
20 |
+
# 底部论文介绍
|
21 |
def format_paper_info(article):
|
22 |
"""Generate HTML content for paper display"""
|
23 |
if not article.paper:
|
|
|
78 |
'<th>👍 Upvotes</th>'
|
79 |
'<th>💬 Comments</th>'
|
80 |
'<th>📅 Date</th>'
|
81 |
+
'<th>Label</th>'
|
82 |
'<th></th>'
|
83 |
'</tr></thead><tbody>']
|
84 |
|
|
|
88 |
comments = article.numComments or 0
|
89 |
date = article.paper.publishedAt.strftime("%Y-%m-%d") if article.paper.publishedAt else "Unknown"
|
90 |
paper_id = article.paper.id
|
91 |
+
label = ", ".join(article.paper.label) or ""
|
92 |
|
93 |
# 构造 arXiv abs 链接
|
94 |
arxiv_abs_link = f"https://huggingface.co/papers/{paper_id}"
|
|
|
99 |
<td>{upvotes}</td>
|
100 |
<td>{comments}</td>
|
101 |
<td>{date}</td>
|
102 |
+
<td>{label}</td>
|
103 |
<td><a href="javascript:void(0)" onclick="showDetail('{paper_id}')" class="sf-button" style="margin: 0">Details{assets.SVG_LINK}</a></td>
|
104 |
</tr>
|
105 |
"""
|
|
|
138 |
papers = sort_by_date(papers, reverse=False)
|
139 |
elif sort_method == "Sort by date descending":
|
140 |
papers = sort_by_date(papers, reverse=True)
|
141 |
+
elif sort_method == "Sort by label":
|
142 |
+
papers = sorted(papers, key=lambda x: ", ".join(x.paper.label))
|
143 |
|
144 |
return generate_table_html(papers), build_html(papers)
|
145 |
except Exception as e:
|
|
|
147 |
return "<p>⚠️ Query failed, please check the date format (YYYY-MM-DD)</p>", "<p>⚠️ Query failed, please check the date format (YYYY-MM-DD)</p>"
|
148 |
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
# CSS 样式(可放入单独文件)
|
151 |
custom_css = """
|
152 |
.detail-area { margin-top: 20px; padding: 20px; border: 1px solid #ddd; border-radius: 5px; }
|
|
|
192 |
# Main interface
|
193 |
gr.HTML("<div style='text-align: center'><h1>📚 Hugging Face Weekly Paper</h1></div>")
|
194 |
gr.HTML("""<div style='text-align: center'>
|
195 |
+
<span style="">
|
196 |
+
🔗 <a href='https://larkcommunity.feishu.cn/wiki/HSSTwsq7JiDur0kJrvjcnFZfnTe'>Contribute to this project</a>
|
197 |
+
</span>
|
198 |
+
<span style="margin-left: 1rem">
|
199 |
+
Sponsor: <a href='https://internlm.intern-ai.org.cn/api/document'>InternLM</a>
|
200 |
+
</span>
|
201 |
+
</div>""")
|
202 |
|
203 |
# Query control area
|
204 |
with gr.Row():
|
|
|
226 |
"Sort by upvotes ascending",
|
227 |
"Sort by comments ascending",
|
228 |
"Sort by date ascending",
|
229 |
+
"Sort by label",
|
230 |
],
|
231 |
value="Sort by upvotes descending",
|
232 |
)
|
parser.py
CHANGED
@@ -21,6 +21,7 @@ class Paper:
|
|
21 |
summary: Optional[str] = None
|
22 |
upvotes: Optional[int] = None
|
23 |
discussionId: Optional[str] = None
|
|
|
24 |
|
25 |
|
26 |
@dataclass
|
|
|
21 |
summary: Optional[str] = None
|
22 |
upvotes: Optional[int] = None
|
23 |
discussionId: Optional[str] = None
|
24 |
+
label: Optional[List[str]] = None
|
25 |
|
26 |
|
27 |
@dataclass
|