From 72a96c90f2aab350de5e06f57587f654d5df1d6b Mon Sep 17 00:00:00 2001 From: Anthony Gitter Date: Sun, 23 Apr 2023 16:33:24 -0500 Subject: [PATCH 01/11] Set write permissions in AI workflow merges https://github.com/manubot/rootstock/pull/493 closes https://github.com/manubot/rootstock/issues/492 * Set write permissions in AI workflow * Add pull-requests write permissions --- .github/workflows/ai-revision.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ai-revision.yaml b/.github/workflows/ai-revision.yaml index fbae61d..58eb0d3 100644 --- a/.github/workflows/ai-revision.yaml +++ b/.github/workflows/ai-revision.yaml @@ -27,6 +27,9 @@ jobs: ai-revise: name: AI Revise runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write defaults: run: shell: bash --login {0} From f9fff34656752c8d268d50c59981f4076036764b Mon Sep 17 00:00:00 2001 From: Anthony Gitter Date: Mon, 17 Jul 2023 14:41:41 -0500 Subject: [PATCH 02/11] Correct setup script typos merges https://github.com/manubot/rootstock/pull/498 --- setup.bash | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.bash b/setup.bash index 4319cc3..6278299 100755 --- a/setup.bash +++ b/setup.bash @@ -15,7 +15,7 @@ echo "OWNER and REPO refer to the details of your manuscript repo location:" echo "i.e. https://github.com/OWNER/REPO." echo echo "Options:" -echo " -o --owner GitHub user or organisation name." +echo " -o --owner GitHub user or organization name." echo " -r --repo Name of the repository for your new manuscript." echo " -y --yes Non-interactive mode. Continue script without asking for confirmation that the repo exists." echo " -s --ssh Use SSH to authenticate GitHub account. HTTPS is used by default." @@ -104,7 +104,7 @@ if [ -z "${OWNER}" ] || [ -z "${REPO}" ]; then echo "First, we need to specify where to create the GitHub repo for your manuscript." echo echo "The URL will take this format: https://github.com/OWNER/REPO." - echo "OWNER is your username or organisation" + echo "OWNER is your username or organization" echo "REPO is the name of your repository" echo read -r -p "Type in the OWNER now:" input @@ -188,13 +188,13 @@ fi case $AUTH in 0) echo - echo "Seting origin URL using its https web address" + echo "Setting origin URL using its https web address" echo git remote set-url origin https://github.com/${OWNER}/${REPO}.git ;; 1) echo - echo "Seting origin URL using SSH" + echo "Setting origin URL using SSH" echo git remote set-url origin git@github.com:$OWNER/$REPO.git ;; From 299abcea4c710cdda024017b54148e24c8d37228 Mon Sep 17 00:00:00 2001 From: Daniel Himmelstein Date: Mon, 31 Jul 2023 13:51:49 -0400 Subject: [PATCH 03/11] CI: install environment using mamba merges https://github.com/manubot/rootstock/pull/501 CI: install environment using mamba. mamba is faster and has better error messages than conda. build/README.md: add mamba instructions to create environment. --- .github/workflows/manubot.yaml | 2 ++ build/README.md | 12 ++++++++++-- ci/install.sh | 6 +++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/manubot.yaml b/.github/workflows/manubot.yaml index 99cdf69..1ef5e98 100644 --- a/.github/workflows/manubot.yaml +++ b/.github/workflows/manubot.yaml @@ -84,7 +84,9 @@ jobs: activate-environment: manubot environment-file: build/environment.yml auto-activate-base: false + miniforge-variant: Mambaforge miniforge-version: 'latest' + use-mamba: true - name: Install Spellcheck if: env.SPELLCHECK == 'true' run: bash ci/install-spellcheck.sh diff --git a/build/README.md b/build/README.md index 28893ab..20e72cd 100644 --- a/build/README.md +++ b/build/README.md @@ -20,12 +20,17 @@ To change the options, either edit the YAML files directly or add additional `-- Note: currently, **Windows is not supported**. -Install the [conda](https://conda.io) environment specified in [`environment.yml`](environment.yml) by running the following commands +The Manubot environment is managed with [conda](https://conda.io). +If you do not have `conda` installed, we recommend using the Miniforge3 (includes `conda`) or Mambaforge (includes `conda` and `mamba`) installers from [miniforge](https://github.com/conda-forge/miniforge). +Install the environment from [`environment.yml`](environment.yml) by running one of following commands (from the repository's root directory): ```sh -# Install the environment +# Install the environment using conda conda env create --file build/environment.yml + +# Install the environment using mamba (faster) +mamba env create --file build/environment.yml ``` If the `manubot` environment is already installed, but needs to be updated to reflect changes to `environment.yml`, use one of the following options: @@ -38,6 +43,9 @@ conda env update --file build/environment.yml # Slower than option 1, but guarantees a fresh environment. conda env remove --name manubot conda env create --file build/environment.yml + +# option 3: reinstall the manubot environment faster using mamba. +mamba env create --force --file build/environment.yml ``` Activate with `conda activate manubot` (assumes `conda` version of [at least](https://github.com/conda/conda/blob/9d759d8edeb86569c25f6eb82053f09581013a2a/CHANGELOG.md#440-2017-12-20) 4.4). diff --git a/ci/install.sh b/ci/install.sh index c264b08..6b20f0e 100755 --- a/ci/install.sh +++ b/ci/install.sh @@ -7,7 +7,7 @@ set -o errexit \ -o pipefail -wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge-pypy3-$(uname)-$(uname -m).sh \ +wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh \ --output-document miniforge.sh bash miniforge.sh -b -p $HOME/miniconda source $HOME/miniconda/etc/profile.d/conda.sh @@ -15,8 +15,8 @@ hash -r conda config \ --set always_yes yes \ --set changeps1 no -conda env create --quiet --file build/environment.yml -conda list --name manubot +mamba env create --quiet --file build/environment.yml +mamba list --name manubot conda activate manubot # Install Spellcheck filter for Pandoc From 8c1a803748961dcf6b7e8ed4d5ec8f8ce6d5a2a9 Mon Sep 17 00:00:00 2001 From: Anthony Gitter Date: Mon, 14 Aug 2023 13:40:02 -0500 Subject: [PATCH 04/11] Improve DOCX environment variable documentation merges https://github.com/manubot/rootstock/pull/503 closes https://github.com/manubot/rootstock/issues/500 --- USAGE.md | 2 ++ build/README.md | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/USAGE.md b/USAGE.md index c867139..5ce07a5 100644 --- a/USAGE.md +++ b/USAGE.md @@ -322,6 +322,8 @@ metadata: csl: https://github.com/citation-style-language/styles/raw/906cd6d43d0c136190ecfbb12f6af0ca794e3c5b/peerj.csl ``` +Instructions for generating additional manuscript output formats such as DOCX can be found in [`build/README.md`](build/README.md). + ## Spellchecking When the `SPELLCHECK` environment variable is `true`, the pandoc [spellcheck filter](https://github.com/pandoc/lua-filters/tree/master/spellcheck) is run. diff --git a/build/README.md b/build/README.md index 20e72cd..3c09035 100644 --- a/build/README.md +++ b/build/README.md @@ -7,8 +7,19 @@ However, setting the `BUILD_PDF` environment variable to `false` will suppress P For example, run local builds using the command `BUILD_PDF=false bash build/build.sh`. To build a DOCX file of the manuscript, set the `BUILD_DOCX` environment variable to `true`. -For example, use the command `BUILD_DOCX=true bash build/build.sh`. -To export DOCX for all CI builds, set an environment variable (see docs for [GitHub Actions](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables)). +For example, use the command `BUILD_DOCX=true bash build/build.sh` locally. +To export DOCX for all CI builds, set an environment variable in the CI configuration file. +For GitHub Actions, set the variable in `.github\workflows\manubot.yaml` (see [docs](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables)): + +```yaml +name: Manubot +env: + BUILD_DOCX: true +``` + +To generate a single DOCX output of the latest manuscript with GitHub Actions, click the "Actions" tab at the top of the repository. +Select the "Manubot" workflow, then the "Run workflow" button and check "generate DOCX output" before clicking the green "Run workflow" button. + Currently, equation numbers via `pandoc-eqnos` are not supported for DOCX output. Format conversion is done using [Pandoc](https://pandoc.org/MANUAL.html). From 48c7d75849f6fa24b2c2d6a529edc028f1b2d029 Mon Sep 17 00:00:00 2001 From: Daniel Himmelstein Date: Wed, 27 Sep 2023 21:02:06 -0400 Subject: [PATCH 05/11] environment: upgrade manubot required to address: cannot import name 'RequestRate' from 'pyrate_limiter' --- build/environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/environment.yml b/build/environment.yml index 30fb360..d6f66fd 100644 --- a/build/environment.yml +++ b/build/environment.yml @@ -21,7 +21,7 @@ dependencies: - pip: - cffi==1.15.0 - errorhandler==2.0.1 - - git+https://github.com/manubot/manubot@d4242ffa4194e4a13a68c5f6466feff559d3f9d5 + - git+https://github.com/manubot/manubot@6e6f6a5aac381120faf3ef02e594b5babc77da2b - isbnlib==3.10.10 - opentimestamps-client==0.7.1 - opentimestamps==0.4.3 From 078af3a959b07118dc2f282357644ed96646ecab Mon Sep 17 00:00:00 2001 From: Milton Pividori Date: Wed, 13 Dec 2023 06:29:42 -0700 Subject: [PATCH 06/11] ai-revision docs: section mapping & prompt types merges https://github.com/manubot/rootstock/pull/496 --- .github/workflows/ai-revision.yaml | 6 ++++++ USAGE.md | 18 ++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ai-revision.yaml b/.github/workflows/ai-revision.yaml index 58eb0d3..db2bac5 100644 --- a/.github/workflows/ai-revision.yaml +++ b/.github/workflows/ai-revision.yaml @@ -17,6 +17,11 @@ on: required: true type: string default: 'text-davinci-003' + custom_prompt: + description: 'Custom prompt' + required: false + type: string + default: '' branch_name: description: 'Output branch' required: true @@ -54,6 +59,7 @@ jobs: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} AI_EDITOR_LANGUAGE_MODEL: ${{ inputs.model }} AI_EDITOR_FILENAMES_TO_REVISE: ${{ inputs.file_names }} + 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/ diff --git a/USAGE.md b/USAGE.md index 5ce07a5..de1848e 100644 --- a/USAGE.md +++ b/USAGE.md @@ -334,7 +334,7 @@ Spellchecking is currently only supported for English language manuscripts. ## AI-assisted authoring The workflow [`ai-revision`](.github/workflows/ai-revision.yaml) is available to assist authors in writing their manuscripts. -It uses large language models to revise the manuscript text, fixing spelling and grammar errors, and improving the sentence structure and the writing style with section-specific prompts. +It uses large language models to revise the manuscript text, fix spelling and grammar errors, and improve the sentence structure and the writing style with section-specific prompts. It is manually triggered by the user (it never runs automatically), and it generates a pull request with suggested revisions. Then the user can review these changes and merge the pull request if they are acceptable. More information about this tool is available in [this manuscript](https://greenelab.github.io/manubot-gpt-manuscript/). @@ -344,7 +344,21 @@ For 1), go to the settings page and, within "Secrets and variables," select "Act Next, create a repository secret with the name `OPENAI_API_KEY` and the value of the API token (you can also do this using "Organization secrets" if available). For 2), go to "Actions", "General", "Workflow permissions", and activate the checkbox "Allow GitHub Actions to create and approve pull requests." -By default, the tool uses the model `text-davinci-003`. +Additionally, you also need to decide which type of prompts you want to use. +"Prompts" are the instructions given to the language model to revise your manuscript. +Basically, you can select 1) the default set of section-specific prompts already provided by the tool, or 2) a custom prompt that you provide. +For 1), you can check [this manuscript](https://greenelab.github.io/manubot-gpt-manuscript/) for a more detailed description of the section-specific prompts. +These prompts are already provided, but they need to know the section of each of your Markdown files (for instance, if it is the abstract, or the introduction, etc.). +For this, the tool will try to infer them from the file names automatically, and if this fails, the tool might not revise all of your files. +In this case, you need to indicate the section of each file using the "section mapping" environment variable that is described [here](https://github.com/manubot/manubot-ai-editor/blob/main/libs/manubot_ai_editor/env_vars.py) (read the header of the file for more instructions). +For 2), you can provide your own custom prompt, which will be used for all the files regardless of their section. +For example, instead of the more complex section-specific prompts in 1), you might just want to perform simpler revision tasks. +An example of a custom prompt is "proofread the following paragraph". +You can provide your custom prompt when you manually trigger the workflow by using the "Custom prompt" field. +This could be more appropriate if you are testing different prompts. +To set a fixed prompt for all runs, read the documentation [here](https://github.com/manubot/manubot-ai-editor/blob/main/libs/manubot_ai_editor/env_vars.py) to set the "custom prompt" environment variable. + +By default, the tool uses the model `text-davinci-003`, but you are encouraged to check the [OpenAI documentation](https://platform.openai.com/docs/models) to see which models are available, which one is the most suitable for your manuscript, and [whether our tool supports it](https://github.com/manubot/manubot-ai-editor). Make sure to check the [pricing](https://openai.com/api/pricing/) of the OpenAI API. With $0.02 per 1000 tokens using the most powerful AI models, the cost for a revision of a standard manuscript (around 35 paragraphs) should be around $0.50. The workflow allows specifying the branch and file names (in the `content/` directory) to revise, the language model to use, and the output branch name. From e786e68ac7f13a24a0824b5bcb9301dda86b7e8c Mon Sep 17 00:00:00 2001 From: Daniel Himmelstein Date: Thu, 18 Jan 2024 21:31:15 -0500 Subject: [PATCH 07/11] CI: appveyor use ubuntu 22.04 refs https://github.com/manubot/rootstock/issues/508 merges https://github.com/manubot/rootstock/pull/509 Fixes appveyor install error: > The repository 'http://apt.postgresql.org/pub/repos/apt bionic-pgdg Release' no longer has a Release file. --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 69d6e6c..978e00f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -20,7 +20,7 @@ only_commits: - ci/install.sh - content/ -image: ubuntu +image: ubuntu2204 services: - docker From f92ea1b72211d2543bac7276995d1b69947c6949 Mon Sep 17 00:00:00 2001 From: Milton Pividori Date: Mon, 25 Mar 2024 20:29:09 -0600 Subject: [PATCH 08/11] ai-revision: change default model to GPT 3.5 Turbo merges https://github.com/manubot/rootstock/pull/510 --- .github/workflows/ai-revision.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ai-revision.yaml b/.github/workflows/ai-revision.yaml index db2bac5..b0f52a3 100644 --- a/.github/workflows/ai-revision.yaml +++ b/.github/workflows/ai-revision.yaml @@ -16,7 +16,7 @@ on: description: 'Language model' required: true type: string - default: 'text-davinci-003' + default: 'gpt-3.5-turbo' custom_prompt: description: 'Custom prompt' required: false @@ -26,7 +26,7 @@ on: description: 'Output branch' required: true type: string - default: 'ai-revision-davinci' + default: 'ai-revision-gpt35' jobs: ai-revise: From edec2417df4bffe58185fff6cb489b1cccdeeaa5 Mon Sep 17 00:00:00 2001 From: Vincent Rubinetti Date: Sun, 14 Jul 2024 22:29:27 -0400 Subject: [PATCH 09/11] ai-editor docs now external merges https://github.com/manubot/rootstock/pull/511 --- USAGE.md | 54 +++++++++++++----------------------------------------- 1 file changed, 13 insertions(+), 41 deletions(-) diff --git a/USAGE.md b/USAGE.md index de1848e..193a928 100644 --- a/USAGE.md +++ b/USAGE.md @@ -333,43 +333,15 @@ Spellchecking is currently only supported for English language manuscripts. ## AI-assisted authoring -The workflow [`ai-revision`](.github/workflows/ai-revision.yaml) is available to assist authors in writing their manuscripts. -It uses large language models to revise the manuscript text, fix spelling and grammar errors, and improve the sentence structure and the writing style with section-specific prompts. -It is manually triggered by the user (it never runs automatically), and it generates a pull request with suggested revisions. -Then the user can review these changes and merge the pull request if they are acceptable. -More information about this tool is available in [this manuscript](https://greenelab.github.io/manubot-gpt-manuscript/). - -You need to change your repository settings to 1) provide a secret with name `OPENAI_API_KEY` containing your OpenAI API token, and 2) allow workflows to create pull requests. -For 1), go to the settings page and, within "Secrets and variables," select "Actions." -Next, create a repository secret with the name `OPENAI_API_KEY` and the value of the API token (you can also do this using "Organization secrets" if available). -For 2), go to "Actions", "General", "Workflow permissions", and activate the checkbox "Allow GitHub Actions to create and approve pull requests." - -Additionally, you also need to decide which type of prompts you want to use. -"Prompts" are the instructions given to the language model to revise your manuscript. -Basically, you can select 1) the default set of section-specific prompts already provided by the tool, or 2) a custom prompt that you provide. -For 1), you can check [this manuscript](https://greenelab.github.io/manubot-gpt-manuscript/) for a more detailed description of the section-specific prompts. -These prompts are already provided, but they need to know the section of each of your Markdown files (for instance, if it is the abstract, or the introduction, etc.). -For this, the tool will try to infer them from the file names automatically, and if this fails, the tool might not revise all of your files. -In this case, you need to indicate the section of each file using the "section mapping" environment variable that is described [here](https://github.com/manubot/manubot-ai-editor/blob/main/libs/manubot_ai_editor/env_vars.py) (read the header of the file for more instructions). -For 2), you can provide your own custom prompt, which will be used for all the files regardless of their section. -For example, instead of the more complex section-specific prompts in 1), you might just want to perform simpler revision tasks. -An example of a custom prompt is "proofread the following paragraph". -You can provide your custom prompt when you manually trigger the workflow by using the "Custom prompt" field. -This could be more appropriate if you are testing different prompts. -To set a fixed prompt for all runs, read the documentation [here](https://github.com/manubot/manubot-ai-editor/blob/main/libs/manubot_ai_editor/env_vars.py) to set the "custom prompt" environment variable. - -By default, the tool uses the model `text-davinci-003`, but you are encouraged to check the [OpenAI documentation](https://platform.openai.com/docs/models) to see which models are available, which one is the most suitable for your manuscript, and [whether our tool supports it](https://github.com/manubot/manubot-ai-editor). -Make sure to check the [pricing](https://openai.com/api/pricing/) of the OpenAI API. -With $0.02 per 1000 tokens using the most powerful AI models, the cost for a revision of a standard manuscript (around 35 paragraphs) should be around $0.50. -The workflow allows specifying the branch and file names (in the `content/` directory) to revise, the language model to use, and the output branch name. -Internally, the workflow uses the tool [Manubot AI Editor](https://github.com/manubot/manubot-ai-editor) to revise the manuscript. -For more advanced users, the behavior of the Manubot AI Editor or the parameters used for the language model can be changed using environment variables. -These variables can be changed in the workflow file (`ai-revision.yaml`). - -It is important to note that using language models in scientific writing is a matter of debate among researchers and journal editors. -Therefore, it's advisable to follow the guidelines that journals and the research community propose. -For example, the *Nature* journal has published [rules about using language models in scholarly writing](https://www.nature.com/articles/d41586-023-00191-1), such as not listing the tools as authors and documenting how they were used. -Since a Manubot-based manuscript uses GitHub, one approach consists of linking the AI-generated pull request, which will transparently show the changes suggested by the AI tool. +Manubot features a powerful integrated _AI Editor_ that can proofread and revise your manuscript. +It can fix lower-level issues such as spelling and grammar errors, but can also make higher-level improvements like simplifying sentence structure, increasing clarity, refining writing style, and more. +You can also customize how it revises your writing in different sections of your manuscript. + +Running the AI Editor is _fully in your control_. +It will only run if you manually trigger the workflow [`ai-revision`](.github/workflows/ai-revision.yaml). +The workflow will generate a pull request with suggested revisions for you to review and either accept or reject. + +For _full documentation and support_, see the separate [`manubot-ai-editor` repo](https://github.com/manubot/manubot-ai-editor) and [our manuscript](https://doi.org/10.1093/jamia/ocae139). ## Manubot feedback @@ -386,12 +358,12 @@ DOI: [10.1371/journal.pcbi.1007128](https://doi.org/10.1371/journal.pcbi.1007128 The Manubot version of this manuscript is available at . -To cite the Manubot AI Editor or for more information on its design, see `@doi:10.1101/2023.01.21.525030`: +To cite the Manubot AI Editor or for more information on its design, see `@doi:10.1093/jamia/ocae139`: -> **A publishing infrastructure for AI-assisted academic authoring**
+> **A publishing infrastructure for Artificial Intelligence (AI)-assisted academic authoring**
Milton Pividori, Casey S. Greene
-*bioRxiv* (2023)
-DOI: [10.1101/2023.01.21.525030](https://doi.org/10.1101/2023.01.21.525030) +*Journal of the American Medical Informatics Association* (2024)
+DOI: [10.1093/jamia/ocae139](https://doi.org/10.1093/jamia/ocae139) ## Acknowledgments From 2d4652d7e8bae7ab7603647181497ab0c77419b2 Mon Sep 17 00:00:00 2001 From: Milton Pividori Date: Wed, 17 Jul 2024 06:07:25 -0600 Subject: [PATCH 10/11] AI Editor: example config files merges https://github.com/manubot/rootstock/pull/512 Co-authored-by: Faisal Alquaddoomi --- .github/workflows/ai-revision.yaml | 4 +-- ci/ai-revision-config.yaml | 8 ++++++ ci/ai-revision-prompts.yaml | 44 ++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 ci/ai-revision-config.yaml create mode 100644 ci/ai-revision-prompts.yaml diff --git a/.github/workflows/ai-revision.yaml b/.github/workflows/ai-revision.yaml index b0f52a3..2b7b2dd 100644 --- a/.github/workflows/ai-revision.yaml +++ b/.github/workflows/ai-revision.yaml @@ -62,9 +62,9 @@ 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@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 }}' diff --git a/ci/ai-revision-config.yaml b/ci/ai-revision-config.yaml new file mode 100644 index 0000000..53b5d82 --- /dev/null +++ b/ci/ai-revision-config.yaml @@ -0,0 +1,8 @@ +files: + ignore: + - front\-matter + - back\-matter + matchings: + - files: + - .*\.md$ + prompt: default diff --git a/ci/ai-revision-prompts.yaml b/ci/ai-revision-prompts.yaml new file mode 100644 index 0000000..64b5d35 --- /dev/null +++ b/ci/ai-revision-prompts.yaml @@ -0,0 +1,44 @@ +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"). + + 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. + + Input paragraph: {{ content }} + + 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]". + + 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: From 31af0d1e7b276a7445d8577f79ca520df6a42421 Mon Sep 17 00:00:00 2001 From: Daniel Himmelstein Date: Sat, 20 Jul 2024 11:15:55 -0400 Subject: [PATCH 11/11] manubot upgrade on 2024-07-20 merges https://github.com/manubot/rootstock/pull/513 fixup 2d4652d7e8bae7ab7603647181497ab0c77419b2 --- build/environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/environment.yml b/build/environment.yml index d6f66fd..7b52880 100644 --- a/build/environment.yml +++ b/build/environment.yml @@ -21,7 +21,7 @@ dependencies: - pip: - cffi==1.15.0 - errorhandler==2.0.1 - - git+https://github.com/manubot/manubot@6e6f6a5aac381120faf3ef02e594b5babc77da2b + - git+https://github.com/manubot/manubot@2914d720dfe02d2bda8781f8f784bc14d461e2e3 - isbnlib==3.10.10 - opentimestamps-client==0.7.1 - opentimestamps==0.4.3