Spaces:
Sleeping
Sleeping
remove rising score
Browse files
papers.py
CHANGED
@@ -13,25 +13,25 @@ class PaperManager:
|
|
13 |
self.papers = []
|
14 |
self.raw_papers = [] # To store fetched data
|
15 |
|
16 |
-
def calculate_rising_score(self, paper):
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
|
36 |
def fetch_papers(self):
|
37 |
try:
|
|
|
13 |
self.papers = []
|
14 |
self.raw_papers = [] # To store fetched data
|
15 |
|
16 |
+
# def calculate_rising_score(self, paper):
|
17 |
+
# """
|
18 |
+
# Calculate the rising score of a paper.
|
19 |
+
# This emphasizes recent upvotes and the rate of upvote accumulation.
|
20 |
+
# """
|
21 |
+
# upvotes = paper.get('paper', {}).get('upvotes', 0)
|
22 |
+
# published_at_str = paper.get('submittedOnDailyAt', datetime.now(timezone.utc).isoformat())
|
23 |
+
# try:
|
24 |
+
# published_time = datetime.fromisoformat(published_at_str.replace('Z', '+00:00'))
|
25 |
+
# except ValueError:
|
26 |
+
# published_time = datetime.now(timezone.utc)
|
27 |
+
|
28 |
+
# time_diff = datetime.now(timezone.utc) - published_time
|
29 |
+
# time_diff_hours = time_diff.total_seconds() / 3600 # Convert time difference to hours
|
30 |
+
|
31 |
+
# # Rising score favors papers that are gaining upvotes quickly
|
32 |
+
# # Adjusted to have a linear decay over time
|
33 |
+
# score = upvotes / (time_diff_hours + 1)
|
34 |
+
# return score
|
35 |
|
36 |
def fetch_papers(self):
|
37 |
try:
|