Spaces:
Running
Running
add date time to file name
Browse files- config.yaml +1 -1
- src/action.py +9 -2
- src/relevancy.py +2 -2
config.yaml
CHANGED
@@ -9,7 +9,7 @@ categories: ["Artificial Intelligence", "Computation and Language", "Machine Lea
|
|
9 |
# will have their papers filtered out.
|
10 |
#
|
11 |
# Must be within 1-10
|
12 |
-
threshold:
|
13 |
|
14 |
# A natural language statement that the large language model will use to judge which papers are relevant
|
15 |
#
|
|
|
9 |
# will have their papers filtered out.
|
10 |
#
|
11 |
# Must be within 1-10
|
12 |
+
threshold: 6
|
13 |
|
14 |
# A natural language statement that the large language model will use to judge which papers are relevant
|
15 |
#
|
src/action.py
CHANGED
@@ -10,6 +10,8 @@ from dotenv import load_dotenv
|
|
10 |
import openai
|
11 |
from relevancy import generate_relevance_score, process_subject_fields
|
12 |
from download_new_papers import get_papers
|
|
|
|
|
13 |
|
14 |
|
15 |
# Hackathon quality code. Don't judge too harshly.
|
@@ -247,7 +249,7 @@ def generate_body(topic, categories, interest, threshold):
|
|
247 |
papers,
|
248 |
query={"interest": interest},
|
249 |
threshold_score=threshold,
|
250 |
-
num_paper_in_prompt=
|
251 |
)
|
252 |
body = "<br><br>".join(
|
253 |
[
|
@@ -273,6 +275,10 @@ def generate_body(topic, categories, interest, threshold):
|
|
273 |
)
|
274 |
return body
|
275 |
|
|
|
|
|
|
|
|
|
276 |
|
277 |
if __name__ == "__main__":
|
278 |
# Load the .env file.
|
@@ -296,7 +302,8 @@ if __name__ == "__main__":
|
|
296 |
threshold = config["threshold"]
|
297 |
interest = config["interest"]
|
298 |
body = generate_body(topic, categories, interest, threshold)
|
299 |
-
|
|
|
300 |
f.write(body)
|
301 |
if os.environ.get("SENDGRID_API_KEY", None):
|
302 |
sg = SendGridAPIClient(api_key=os.environ.get("SENDGRID_API_KEY"))
|
|
|
10 |
import openai
|
11 |
from relevancy import generate_relevance_score, process_subject_fields
|
12 |
from download_new_papers import get_papers
|
13 |
+
from datetime import date
|
14 |
+
|
15 |
|
16 |
|
17 |
# Hackathon quality code. Don't judge too harshly.
|
|
|
249 |
papers,
|
250 |
query={"interest": interest},
|
251 |
threshold_score=threshold,
|
252 |
+
num_paper_in_prompt=20,
|
253 |
)
|
254 |
body = "<br><br>".join(
|
255 |
[
|
|
|
275 |
)
|
276 |
return body
|
277 |
|
278 |
+
def get_date():
|
279 |
+
today = date.today()
|
280 |
+
formatted_date = today.strftime("%d%m%Y")
|
281 |
+
return formatted_date
|
282 |
|
283 |
if __name__ == "__main__":
|
284 |
# Load the .env file.
|
|
|
302 |
threshold = config["threshold"]
|
303 |
interest = config["interest"]
|
304 |
body = generate_body(topic, categories, interest, threshold)
|
305 |
+
today_date = get_date()
|
306 |
+
with open(f"digest_{today_date}.html", "w") as f:
|
307 |
f.write(body)
|
308 |
if os.environ.get("SENDGRID_API_KEY", None):
|
309 |
sg = SendGridAPIClient(api_key=os.environ.get("SENDGRID_API_KEY"))
|
src/relevancy.py
CHANGED
@@ -106,8 +106,8 @@ def generate_relevance_score(
|
|
106 |
all_papers,
|
107 |
query,
|
108 |
model_name="gpt-3.5-turbo-16k",
|
109 |
-
threshold_score=
|
110 |
-
num_paper_in_prompt=
|
111 |
temperature=0.4,
|
112 |
top_p=1.0,
|
113 |
sorting=True
|
|
|
106 |
all_papers,
|
107 |
query,
|
108 |
model_name="gpt-3.5-turbo-16k",
|
109 |
+
threshold_score=7,
|
110 |
+
num_paper_in_prompt=8,
|
111 |
temperature=0.4,
|
112 |
top_p=1.0,
|
113 |
sorting=True
|