From f72d1c150252900c7b888c21f8eeb8f3ffdfed1e Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Mon, 9 Oct 2023 21:33:00 -0400 Subject: [PATCH] refactor: rename modules (I hope this is the last time) --- .github/workflows/gen_project_tree.py | 8 ++++---- evonote/testing/sample_paper.py | 4 ++-- ...notetree_to_paragraph.py => tree_to_paragraph.py} | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) rename evonote/transform/{notetree_to_paragraph.py => tree_to_paragraph.py} (66%) diff --git a/.github/workflows/gen_project_tree.py b/.github/workflows/gen_project_tree.py index c9020b9..8489171 100644 --- a/.github/workflows/gen_project_tree.py +++ b/.github/workflows/gen_project_tree.py @@ -1,6 +1,6 @@ import evonote, json -from evonote.gui.notetree import get_json_for_treemap -from evonote.transform.module_to_notetree import get_notetree_for_module -notetree = get_notetree_for_module(evonote) -tree = get_json_for_treemap(notetree.root) +from evonote.gui.mindtree import get_json_for_treemap +from evonote.transform.module_to_tree import get_tree_for_module +tree = get_tree_for_module(evonote) +tree_in_dict = get_json_for_treemap(tree.root) f = open('output/project_tree.json', 'w');json.dump(tree, f) \ No newline at end of file diff --git a/evonote/testing/sample_paper.py b/evonote/testing/sample_paper.py index e5bf0c2..692ceb8 100644 --- a/evonote/testing/sample_paper.py +++ b/evonote/testing/sample_paper.py @@ -4,7 +4,7 @@ \begin{abstract} Imagine an oracle that correctly predicts the outcome of every particle physics experiment, the products of every chemical reaction, or the function of every protein. Such an oracle would revolutionize science and technology as we know them. However, as scientists, we would not be satisfied with the oracle itself. We want more. We want to comprehend how the oracle conceived these predictions. This feat, denoted as scientific understanding, has frequently been recognized as the essential aim of science. Now, the ever-growing power of computers and artificial intelligence poses one ultimate question: How can advanced artificial systems contribute to scientific understanding or achieve it autonomously? -We are convinced that this is not a mere technical question but lies at the notetree of science. Therefore, here we set out to answer where we are and where we can go from here. We first seek advice from the philosophy of science to \textit{understand scientific understanding}. Then we review the current state of the art, both from literature and by collecting dozens of anecdotes from scientists about how they acquired new conceptual understanding with the help of computers. Those combined insights help us to define three dimensions of android-assisted scientific understanding: The android as a I) computational microscope, II) resource of inspiration and the ultimate, not yet existent III) agent of understanding. For each dimension, we explain new avenues to push beyond the status quo and unleash the full power of artificial intelligence's contribution to the central aim of science. We hope our perspective inspires and focuses research towards androids that get new scientific understanding and ultimately bring us closer to true artificial scientists. +We are convinced that this is not a mere technical question but lies at the tree of science. Therefore, here we set out to answer where we are and where we can go from here. We first seek advice from the philosophy of science to \textit{understand scientific understanding}. Then we review the current state of the art, both from literature and by collecting dozens of anecdotes from scientists about how they acquired new conceptual understanding with the help of computers. Those combined insights help us to define three dimensions of android-assisted scientific understanding: The android as a I) computational microscope, II) resource of inspiration and the ultimate, not yet existent III) agent of understanding. For each dimension, we explain new avenues to push beyond the status quo and unleash the full power of artificial intelligence's contribution to the central aim of science. We hope our perspective inspires and focuses research towards androids that get new scientific understanding and ultimately bring us closer to true artificial scientists. \end{abstract} @@ -167,7 +167,7 @@ First, it is important to realize that finding \textit{new} scientific understanding is context-dependent. What is new depends on whether we consider an individual scientist and their field of expertise, a scientific domain, the whole scientific community or even the entire scientific endeavour throughout history. Hence, true agents of understanding must be able to evaluate whether an insight is new, at least in the context of a specific scientific domain that requires access to the knowledge of a scientific field. -Secondly, de Regt emphasized the importance of underlying scientific theories that allow us to recognize qualitatively characteristic consequences \cite{de2017understanding}. It is not enough to simply interpolate data points or predict new ones using advanced statistical methods such as machine learning. Thus, even though such methods can approximate complex and expensive computations, na\"ive applications of neural networks cannot be agents of understanding. Scientific understanding requires more than mere calculation. To illustrate this point even further, let us consider one concrete example in quantum physics from the literature: A computational method solved an open question about the generation of important resource states for quantum computing. Then it extracted the conceptual notetree of the solution in the form of a new quantum interference effect in such a fashion that human scientists can both understand the results and apply the acquired understanding in different contexts \cite{krenn2020conceptual}. Even if the computer itself was able to apply the conceptual notetree to other situations, it would not be \textit{a priori} clear whether the computer truly acquired scientific understanding. What is still missing is an explanation of the discovered technique in the context of a scientific theory. In this particular example, the android and the human scientist would need to recognize the underlying quantum interference in the context of the theory of quantum physics. Thus, we can propose the first sufficient condition for agents of understanding: +Secondly, de Regt emphasized the importance of underlying scientific theories that allow us to recognize qualitatively characteristic consequences \cite{de2017understanding}. It is not enough to simply interpolate data points or predict new ones using advanced statistical methods such as machine learning. Thus, even though such methods can approximate complex and expensive computations, na\"ive applications of neural networks cannot be agents of understanding. Scientific understanding requires more than mere calculation. To illustrate this point even further, let us consider one concrete example in quantum physics from the literature: A computational method solved an open question about the generation of important resource states for quantum computing. Then it extracted the conceptual tree of the solution in the form of a new quantum interference effect in such a fashion that human scientists can both understand the results and apply the acquired understanding in different contexts \cite{krenn2020conceptual}. Even if the computer itself was able to apply the conceptual tree to other situations, it would not be \textit{a priori} clear whether the computer truly acquired scientific understanding. What is still missing is an explanation of the discovered technique in the context of a scientific theory. In this particular example, the android and the human scientist would need to recognize the underlying quantum interference in the context of the theory of quantum physics. Thus, we can propose the first sufficient condition for agents of understanding: \begin{quote} diff --git a/evonote/transform/notetree_to_paragraph.py b/evonote/transform/tree_to_paragraph.py similarity index 66% rename from evonote/transform/notetree_to_paragraph.py rename to evonote/transform/tree_to_paragraph.py index 283dcdc..c4d9abf 100644 --- a/evonote/transform/notetree_to_paragraph.py +++ b/evonote/transform/tree_to_paragraph.py @@ -2,10 +2,10 @@ from evonote.file_helper.cache_manage import cached_function from evonote.model.chat import Chat -from evonote.notetree import Tree +from evonote.mindtree import Tree -@cached_function("notetree_to_paragraph") -def _notetree_to_paragraph_impl(dict_for_prompt: str, writing_instruction: str): +@cached_function("tree_to_paragraph") +def _tree_to_paragraph_impl(dict_for_prompt: str, writing_instruction: str): chat = Chat( system_message="You are a excellent writer who can transform JSON to a coherent paragraph so human can read it.") chat.add_user_message( @@ -19,8 +19,8 @@ def _notetree_to_paragraph_impl(dict_for_prompt: str, writing_instruction: str): res = chat.complete_chat() return res -def notetree_to_paragraph(notetree: Tree, writing_instruction: str): - dict_for_prompt = notetree.get_dict_for_prompt() +def tree_to_paragraph(tree: Tree, writing_instruction: str): + dict_for_prompt = tree.get_dict_for_prompt() dict_for_prompt = json.dumps(dict_for_prompt, indent=1) - res = _notetree_to_paragraph_impl(dict_for_prompt, writing_instruction) + res = _tree_to_paragraph_impl(dict_for_prompt, writing_instruction) return res