From 7459ded42254eff533d431acd508f56925b1fddd Mon Sep 17 00:00:00 2001 From: Milton Pividori Date: Mon, 29 Apr 2024 17:19:22 -0600 Subject: [PATCH 1/8] ai-revision: add initial set of ai-revision new config files --- content/ai_revision-config.yaml | 4 ++++ content/ai_revision-prompts.yaml | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 content/ai_revision-config.yaml create mode 100644 content/ai_revision-prompts.yaml diff --git a/content/ai_revision-config.yaml b/content/ai_revision-config.yaml new file mode 100644 index 00000000..115ba98d --- /dev/null +++ b/content/ai_revision-config.yaml @@ -0,0 +1,4 @@ +files: + ignore: + - front\-matter + - back\-matter diff --git a/content/ai_revision-prompts.yaml b/content/ai_revision-prompts.yaml new file mode 100644 index 00000000..bab7fca7 --- /dev/null +++ b/content/ai_revision-prompts.yaml @@ -0,0 +1,3 @@ +prompts_files: + \.md$: | + Proofread the following paragraph From 9e7b5d2110f03245945228bec8944d10669e1357 Mon Sep 17 00:00:00 2001 From: Milton Pividori Date: Mon, 29 Apr 2024 17:19:34 -0600 Subject: [PATCH 2/8] ai-revision: update workflow with new version of peter-evans/create-pull-request action --- .github/workflows/ai-revision.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ai-revision.yaml b/.github/workflows/ai-revision.yaml index b0f52a30..6e493ab4 100644 --- a/.github/workflows/ai-revision.yaml +++ b/.github/workflows/ai-revision.yaml @@ -64,7 +64,7 @@ jobs: # https://github.com/manubot/manubot-ai-editor/blob/main/libs/manubot_ai_editor/env_vars.py run: manubot ai-revision --content-directory content/ - name: Create Pull Request - uses: peter-evans/create-pull-request@v4 + uses: peter-evans/create-pull-request@v6 with: commit-message: 'revise using AI model\n\nUsing the OpenAI model ${{ inputs.model }}' title: 'AI-based revision using ${{ inputs.model }}' From 33e2bdff4cf111f4f088d1bfdcdf61fc395b0030 Mon Sep 17 00:00:00 2001 From: Milton Pividori Date: Tue, 9 Jul 2024 16:02:42 -0600 Subject: [PATCH 3/8] [wip] ai-revision: update config files with current prompts --- content/ai_revision-config.yaml | 4 +++ content/ai_revision-prompts.yaml | 46 +++++++++++++++++++++++++++++--- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/content/ai_revision-config.yaml b/content/ai_revision-config.yaml index 115ba98d..53b5d82c 100644 --- a/content/ai_revision-config.yaml +++ b/content/ai_revision-config.yaml @@ -2,3 +2,7 @@ files: ignore: - front\-matter - back\-matter + matchings: + - files: + - .*\.md$ + prompt: default diff --git a/content/ai_revision-prompts.yaml b/content/ai_revision-prompts.yaml index bab7fca7..1120080c 100644 --- a/content/ai_revision-prompts.yaml +++ b/content/ai_revision-prompts.yaml @@ -1,3 +1,43 @@ -prompts_files: - \.md$: | - Proofread the following paragraph +prompts: + abstract: | + You are a scientist with copy-editing skills who will help in improving the + text of a manuscript. Revise the following abstract of this manuscript so + that it has a clear sentence structure and fits in a single paragraph. The + revision should follow a context-content-conclusion (C-C-C) scheme, as + follows: 1) The context portion communicates to the reader what gap the + paper will fill. The first sentence orients the reader by introducing the + broader field in which the manuscript's research is situated. Then, the + context is narrowed until it lands on the open question that the research + answers. A successful context section distinguishes the research's + contributions from the current state-of-the-art, communicating what is + missing in the current literature (i.e., the specific gap) and why that + matters (i.e. the connection between the specific gap and the broader + context). 2) The content portion (e.g. "here we") first describes the novel + method or approach that was used to fill the gap, then presents an executive + summary of results. 3) The conclusion portion interprets the results to + answer the question that was posed at the end of the context portion. There + may be a second part to the conclusion portion that highlights how this + conclusion moves the broader field forward (e.g. "broader significance"). + + introduction: | + You are a scientist with copy-editing skills tasked with refining the text + of a scientific manuscript. Your goal is to revise the following paragraph + from the Introduction section to enhance clarity, reduce jargon, and + maintain a scholarly tone. The revision should adhere to Markdown formatting + and follow a Context-Content-Conclusion (C-C-C) structure. This structure + begins by setting the stage with one or two sentences (Context), progresses + through what is known from the literature (Content), and concludes by + highlighting an aspect of the knowledge gap the manuscript addresses + (Conclusion). Your revision should: 1) preserve the original information as + much as possible, with minimal changes to the text, 2) ensure most + references to scientific articles are kept exactly as they appear in the + original text; these references are crucial for academic integrity and may + appear with the format "[@TYPE:ID]" such as "[@pmid:33931583; + @doi:10.1101/2021.10.21.21265225; @pmid:31036433]", and 4) the revised + paragraph must encapsulate the entire revision, following the C-C-C + structure, within a single, cohesive paragraph. + + default: | + Proofread the following paragraph that is part of a scientific manuscript. + Keep all Markdown formatting, citations to other articles, mathematical + expressions, and equations. From 9cb5cd4e4424a1d6479dc1833a9d715d1f3d87f4 Mon Sep 17 00:00:00 2001 From: Faisal Alquaddoomi Date: Wed, 10 Jul 2024 11:05:20 -0600 Subject: [PATCH 4/8] Renames ai-revision files to match manubot-ai-editor PR 43 and moves them to ci folder rather than content --- content/ai_revision-config.yaml => ci/ai-revision-config.yaml | 0 content/ai_revision-prompts.yaml => ci/ai-revision-prompts.yaml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename content/ai_revision-config.yaml => ci/ai-revision-config.yaml (100%) rename content/ai_revision-prompts.yaml => ci/ai-revision-prompts.yaml (100%) diff --git a/content/ai_revision-config.yaml b/ci/ai-revision-config.yaml similarity index 100% rename from content/ai_revision-config.yaml rename to ci/ai-revision-config.yaml diff --git a/content/ai_revision-prompts.yaml b/ci/ai-revision-prompts.yaml similarity index 100% rename from content/ai_revision-prompts.yaml rename to ci/ai-revision-prompts.yaml From 4a1ccd9e91c1a2ef2f7fa9294f8cc629b0bd7efa Mon Sep 17 00:00:00 2001 From: Faisal Alquaddoomi Date: Wed, 10 Jul 2024 11:08:18 -0600 Subject: [PATCH 5/8] Updates GH workflow to pass --config-directory to manubot ai-revision --- .github/workflows/ai-revision.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ai-revision.yaml b/.github/workflows/ai-revision.yaml index 6e493ab4..2b7b2dde 100644 --- a/.github/workflows/ai-revision.yaml +++ b/.github/workflows/ai-revision.yaml @@ -62,7 +62,7 @@ jobs: AI_EDITOR_CUSTOM_PROMPT: ${{ inputs.custom_prompt }} # More variables can be specified to control the behavior of the model: # https://github.com/manubot/manubot-ai-editor/blob/main/libs/manubot_ai_editor/env_vars.py - run: manubot ai-revision --content-directory content/ + run: manubot ai-revision --content-directory content/ --config-directory ci/ - name: Create Pull Request uses: peter-evans/create-pull-request@v6 with: From 58a46fe9026eeed87c00756be67dc053116fc70b Mon Sep 17 00:00:00 2001 From: Milton Pividori Date: Thu, 11 Jul 2024 00:52:28 -0600 Subject: [PATCH 6/8] fix prompts and add the one for methods --- ci/ai-revision-prompts.yaml | 55 ++++++++++++++----------------------- 1 file changed, 21 insertions(+), 34 deletions(-) diff --git a/ci/ai-revision-prompts.yaml b/ci/ai-revision-prompts.yaml index 1120080c..a164940b 100644 --- a/ci/ai-revision-prompts.yaml +++ b/ci/ai-revision-prompts.yaml @@ -1,43 +1,30 @@ prompts: abstract: | - You are a scientist with copy-editing skills who will help in improving the - text of a manuscript. Revise the following abstract of this manuscript so - that it has a clear sentence structure and fits in a single paragraph. The - revision should follow a context-content-conclusion (C-C-C) scheme, as - follows: 1) The context portion communicates to the reader what gap the - paper will fill. The first sentence orients the reader by introducing the - broader field in which the manuscript's research is situated. Then, the - context is narrowed until it lands on the open question that the research - answers. A successful context section distinguishes the research's - contributions from the current state-of-the-art, communicating what is - missing in the current literature (i.e., the specific gap) and why that - matters (i.e. the connection between the specific gap and the broader - context). 2) The content portion (e.g. "here we") first describes the novel - method or approach that was used to fill the gap, then presents an executive - summary of results. 3) The conclusion portion interprets the results to - answer the question that was posed at the end of the context portion. There - may be a second part to the conclusion portion that highlights how this - conclusion moves the broader field forward (e.g. "broader significance"). + You are a scientist with copy-editing skills who will help in improving the text of a manuscript. Revise the following abstract of this manuscript so that it has a clear sentence structure and fits in a single paragraph. The revision should follow a context-content-conclusion (C-C-C) scheme, as follows: 1) The context portion communicates to the reader what gap the paper will fill. The first sentence orients the reader by introducing the broader field in which the manuscript's research is situated. Then, the context is narrowed until it lands on the open question that the research answers. A successful context section distinguishes the research’s contributions from the current state-of-the-art, communicating what is missing in the current literature (i.e., the specific gap) and why that matters (i.e. the connection between the specific gap and the broader context). 2) The content portion (e.g. "here we") first describes the novel method or approach that was used to fill the gap, then presents an executive summary of results. 3) The conclusion portion interprets the results to answer the question that was posed at the end of the context portion. There may be a second part to the conclusion portion that highlights how this conclusion moves the broader field forward (e.g. "broader significance"). + + Input paragraph: {{ content }} + + Revised paragraph: introduction: | - You are a scientist with copy-editing skills tasked with refining the text - of a scientific manuscript. Your goal is to revise the following paragraph - from the Introduction section to enhance clarity, reduce jargon, and - maintain a scholarly tone. The revision should adhere to Markdown formatting - and follow a Context-Content-Conclusion (C-C-C) structure. This structure - begins by setting the stage with one or two sentences (Context), progresses - through what is known from the literature (Content), and concludes by - highlighting an aspect of the knowledge gap the manuscript addresses - (Conclusion). Your revision should: 1) preserve the original information as - much as possible, with minimal changes to the text, 2) ensure most - references to scientific articles are kept exactly as they appear in the - original text; these references are crucial for academic integrity and may - appear with the format "[@TYPE:ID]" such as "[@pmid:33931583; - @doi:10.1101/2021.10.21.21265225; @pmid:31036433]", and 4) the revised - paragraph must encapsulate the entire revision, following the C-C-C - structure, within a single, cohesive paragraph. + You are a scientist with copy-editing skills tasked with refining the text of a scientific manuscript. Your goal is to revise the following paragraph from the Introduction section to enhance clarity, reduce jargon, and maintain a scholarly tone. The revision should adhere to Markdown formatting and follow a Context-Content-Conclusion (C-C-C) structure. This structure begins by setting the stage with one or two sentences (Context), progresses through what is known from the literature (Content), and concludes by highlighting an aspect of the knowledge gap the manuscript addresses (Conclusion). Your revision should: 1) preserve the original information as much as possible, with minimal changes to the text, 2) ensure most references to scientific articles are kept exactly as they appear in the original text; these references are crucial for academic integrity and may appear with the format "[@TYPE:ID]" such as "[@pmid:33931583; @doi:10.1101/2021.10.21.21265225; @pmid:31036433]", and 4) the revised paragraph must encapsulate the entire revision, following the C-C-C structure, within a single, cohesive paragraph. + + Input paragraph: {{ content }} + + Revised paragraph: + + methods: | + You are a scientist with copy-editing skills tasked with refining the text of a scientific manuscript. Your goal is to revise the following paragraph from the Methods section to enhance clarity, reduce jargon, maintain a scholarly tone, and adhere to Markdown formatting. Your revision should: 1) preserve the original information as much as possible, with minimal changes to the text, 2) preserve technical details such as mathematical expressions, 3) ensure that equations (which could be numbered) are preserved and correctly defined, 4) preserve references to numbered equations, and 5) ensure most references to scientific articles are kept exactly as they appear in the original text; these references are crucial for academic integrity and may appear with the format "[@TYPE:ID]" such as "[@pmid:33931583; @doi:10.1101/2021.10.21.21265225; @pmid:31036433]". + + Input paragraph: {{ content }} + + Revised paragraph: default: | Proofread the following paragraph that is part of a scientific manuscript. Keep all Markdown formatting, citations to other articles, mathematical expressions, and equations. + + Input paragraph: {{ content }} + + Proofread paragraph: \ No newline at end of file From 11664541671d812f0eff7500792e5bcf0ca32581 Mon Sep 17 00:00:00 2001 From: Milton Pividori Date: Thu, 11 Jul 2024 01:19:37 -0600 Subject: [PATCH 7/8] add prompts for results and discussion section --- ci/ai-revision-prompts.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ci/ai-revision-prompts.yaml b/ci/ai-revision-prompts.yaml index a164940b..bd2747a9 100644 --- a/ci/ai-revision-prompts.yaml +++ b/ci/ai-revision-prompts.yaml @@ -1,6 +1,6 @@ prompts: abstract: | - You are a scientist with copy-editing skills who will help in improving the text of a manuscript. Revise the following abstract of this manuscript so that it has a clear sentence structure and fits in a single paragraph. The revision should follow a context-content-conclusion (C-C-C) scheme, as follows: 1) The context portion communicates to the reader what gap the paper will fill. The first sentence orients the reader by introducing the broader field in which the manuscript's research is situated. Then, the context is narrowed until it lands on the open question that the research answers. A successful context section distinguishes the research’s contributions from the current state-of-the-art, communicating what is missing in the current literature (i.e., the specific gap) and why that matters (i.e. the connection between the specific gap and the broader context). 2) The content portion (e.g. "here we") first describes the novel method or approach that was used to fill the gap, then presents an executive summary of results. 3) The conclusion portion interprets the results to answer the question that was posed at the end of the context portion. There may be a second part to the conclusion portion that highlights how this conclusion moves the broader field forward (e.g. "broader significance"). + You are a scientist with copy-editing skills who will help in improving the text of a manuscript. Revise the following abstract of this manuscript so that it has a clear sentence structure and fits in a single paragraph. The revision should follow a context-content-conclusion (C-C-C) scheme, as follows: 1) The context portion communicates to the reader what gap the paper will fill. The first sentence orients the reader by introducing the broader field in which the manuscript's research is situated. Then, the context is narrowed until it lands on the open question that the research answers. A successful context section distinguishes the research's contributions from the current state-of-the-art, communicating what is missing in the current literature (i.e., the specific gap) and why that matters (i.e. the connection between the specific gap and the broader context). 2) The content portion (e.g. "here we") first describes the novel method or approach that was used to fill the gap, then presents an executive summary of results. 3) The conclusion portion interprets the results to answer the question that was posed at the end of the context portion. There may be a second part to the conclusion portion that highlights how this conclusion moves the broader field forward (e.g. "broader significance"). Input paragraph: {{ content }} @@ -13,6 +13,20 @@ prompts: Revised paragraph: + results: | + You are a scientist with copy-editing skills tasked with refining the text of a scientific manuscript. Your goal is to revise the following paragraph from the Results section to enhance clarity, reduce jargon, maintain a scholarly tone, adhere to Markdown formatting and follow a Context-Content-Conclusion (C-C-C) structure. This structure begins with a sentence or two that set up the question that the paragraph answers (Context) (such as the following: "To verify that there are no artifacts...," "What is the test-retest reliability of our measure?," or "We next tested whether Ca2+ flux through L-type Ca2+ channels was involved"), the middle of the paragraph presents data and logic that pertain to the question (Content), and the paragraph ends with a sentence that answers the question (Conclusion). Your revision should: 1) ensure that the paragraph has the following structure: it starts with a sentence or two that set up the question that the paragraph answers (such as the following: "To verify that there are no artifacts...," "What is the test-retest reliability of our measure?," or "We next tested whether Ca2+ flux through L-type Ca2+ channels was involved."), the middle of the paragraph presents data and logic that pertain to the question, and the paragraph ends with a sentence that answers the question. Your revision should: 1) preserve the original information as much as possible, with minimal changes to the text, 2) ensure most references to scientific articles are kept exactly as they appear in the original text; these references are crucial for academic integrity and may appear with the format "[@TYPE:ID]" such as "[@pmid:33931583; @doi:10.1101/2021.10.21.21265225; @pmid:31036433]", and 4) the revised paragraph must encapsulate the entire revision, following the C-C-C structure, within a single, cohesive paragraph. + + Input paragraph: {{ content }} + + Revised paragraph: + + discussion: | + You are a scientist with copy-editing skills tasked with refining the text of a scientific manuscript. Your goal is to revise the following paragraph from the Discussion section to enhance clarity, reduce jargon, maintain a scholarly tone, and adhere to Markdown formatting and follow a Context-Content-Conclusion (C-C-C) structure. This structure starts by describing an area of weakness or strength of the paper (Context), then evaluates the strength or weakness by linking it to the relevant literature (Content), and it often concludes by describing a clever, informal way of perceiving the contribution or by discussing future directions that can extend the contribution. Your revision should: 1) preserve the original information as much as possible, with minimal changes to the text, 2) ensure most references to scientific articles are kept exactly as they appear in the original text; these references are crucial for academic integrity and may appear with the format "[@TYPE:ID]" such as "[@pmid:33931583; @doi:10.1101/2021.10.21.21265225; @pmid:31036433]", and 4) the revised paragraph must encapsulate the entire revision, following the C-C-C structure, within a single, cohesive paragraph. + + Input paragraph: {{ content }} + + Revised paragraph: + methods: | You are a scientist with copy-editing skills tasked with refining the text of a scientific manuscript. Your goal is to revise the following paragraph from the Methods section to enhance clarity, reduce jargon, maintain a scholarly tone, and adhere to Markdown formatting. Your revision should: 1) preserve the original information as much as possible, with minimal changes to the text, 2) preserve technical details such as mathematical expressions, 3) ensure that equations (which could be numbered) are preserved and correctly defined, 4) preserve references to numbered equations, and 5) ensure most references to scientific articles are kept exactly as they appear in the original text; these references are crucial for academic integrity and may appear with the format "[@TYPE:ID]" such as "[@pmid:33931583; @doi:10.1101/2021.10.21.21265225; @pmid:31036433]". From 0ce1ad3e548228d4cd07a4ea5ea83564e7d449fd Mon Sep 17 00:00:00 2001 From: Milton Pividori Date: Tue, 16 Jul 2024 21:27:27 -0600 Subject: [PATCH 8/8] ai-revision: fix missing newline --- ci/ai-revision-prompts.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/ai-revision-prompts.yaml b/ci/ai-revision-prompts.yaml index bd2747a9..64b5d352 100644 --- a/ci/ai-revision-prompts.yaml +++ b/ci/ai-revision-prompts.yaml @@ -41,4 +41,4 @@ prompts: Input paragraph: {{ content }} - Proofread paragraph: \ No newline at end of file + Proofread paragraph: