diff --git a/main.py b/main.py index 3a7964e..7c8f989 100755 --- a/main.py +++ b/main.py @@ -9,10 +9,10 @@ import json OUTPUT_FILE = "results.json" -HTML_EXAMPLE = r"""

Statistical and Computational Aspects of Dynamics
Organized by Buddhima Kasun Fernando Akurugodage (Centro di ricerca matematica Ennio De Giorgi – SNS), Paolo Giulietti, and Tanja Isabelle Schindler (Universität Wien, Austria). Centro De Giorgi – SNS, Pisa. December 13 – 16, 2022.

""" +HTML_EXAMPLE_1 = r"""

Statistical and Computational Aspects of Dynamics
Organized by Buddhima Kasun Fernando Akurugodage (Centro di ricerca matematica Ennio De Giorgi – SNS), Paolo Giulietti, and Tanja Isabelle Schindler (Universität Wien, Austria). Centro De Giorgi – SNS, Pisa. December 13 – 16, 2022.

""" -OUTPUT_EXAMPLE = json.dumps({ +OUTPUT_EXAMPLE_1 = json.dumps({ "title": "Statistical and Computational Aspects of Dynamics", "url": "http://www.crm.sns.it/event/507/", "description": "Organized by Buddhima Kasun Fernando Akurugodage (Centro di ricerca matematica Ennio De Giorgi – SNS), Paolo Giulietti, and Tanja Isabelle Schindler (Universität Wien, Austria). Location: Centro De Giorgi - SNS, Pisa.", @@ -21,6 +21,18 @@ OUTPUT_EXAMPLE = json.dumps({ }) +HTML_EXAMPLE_2 = r"""

Workshop on Variational problems, PDEs and applications
Organized by Luigi Berselli, Giuseppe Buttazzo, Matteo Novaga, and Andrea Malchiodi (Scuola Normale Superiore, Pisa). Department of Mathematics, Pisa. January 17 – 18, 2020.

""" + + +OUTPUT_EXAMPLE_2 = json.dumps({ + "title": "Workshop on Variational problems, PDEs and applications", + "url": "http://pagine.dm.unipi.it/berselli/meeting2020/", + "description": "Organized by Luigi Berselli, Giuseppe Buttazzo, Matteo Novaga, and Andrea Malchiodi (Scuola Normale Superiore, Pisa). Location: Department of Mathematics, Pisa.", + "startDate": "2020-01-17", + "endDate": "2020-01-18", +}) + + def translate_to_json(conference_html: str) -> str: llm_answer = llm.create_chat_completion( max_tokens=None, @@ -30,9 +42,13 @@ def translate_to_json(conference_html: str) -> str: "content": "You are an assistant. Be precise in formatting the output and only output valid JSON using the specificied fields, without including additional fields or comments.", }, {"role": "user", "content": "INPUT:"}, - {"role": "user", "content": HTML_EXAMPLE }, + {"role": "user", "content": HTML_EXAMPLE_1 }, + {"role": "user", "content": "OUTPUT JSON:"}, + {"role": "user", "content": OUTPUT_EXAMPLE_1}, + {"role": "user", "content": "INPUT:"}, + {"role": "user", "content": HTML_EXAMPLE_2 }, {"role": "user", "content": "OUTPUT JSON:"}, - {"role": "user", "content": OUTPUT_EXAMPLE}, + {"role": "user", "content": OUTPUT_EXAMPLE_2}, {"role": "user", "content": "INPUT:"}, {"role": "user", "content": conference_html }, {"role": "user", "content": "OUTPUT JSON:"},