HowardZhangdqs commited on
Commit
d91c7bd
·
1 Parent(s): ac02643

chore: remove label

Browse files
Files changed (2) hide show
  1. fetch_paper.py +3 -3
  2. interface.py +7 -7
fetch_paper.py CHANGED
@@ -109,11 +109,11 @@ def fetch_papers_with_daterange(start_date: Date, end_date: Date):
109
  "id": article.paper.id
110
  }, preprocessed_articles))
111
 
112
- classified_articles = classify_papers(preprocessed_articles)
113
 
114
  # 遍历 classified_articles,将分类结果写入到 unique_articles 中
115
- for article in classified_articles:
116
- unique_articles[article["id"]].paper.label = article["category"]
117
 
118
  return list(unique_articles.values())
119
 
 
109
  "id": article.paper.id
110
  }, preprocessed_articles))
111
 
112
+ # classified_articles = classify_papers(preprocessed_articles)
113
 
114
  # 遍历 classified_articles,将分类结果写入到 unique_articles 中
115
+ # for article in classified_articles:
116
+ # unique_articles[article["id"]].paper.label = article["category"]
117
 
118
  return list(unique_articles.values())
119
 
interface.py CHANGED
@@ -78,7 +78,7 @@ def generate_table_html(papers):
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,7 +88,7 @@ def generate_table_html(papers):
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,10 +99,10 @@ def generate_table_html(papers):
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
- """
106
  html.append(row)
107
 
108
  html.append("</tbody></table>")
@@ -138,8 +138,8 @@ def query_papers(start_date_str: str, end_date_str: str, sort_method: str): # A
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:
@@ -226,7 +226,7 @@ def create_interface():
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
  )
 
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
+
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
+ """ # <td>{label}</td>
106
  html.append(row)
107
 
108
  html.append("</tbody></table>")
 
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:
 
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
  )