Skip to content

Commit

Permalink
improve the document hands-on
Browse files Browse the repository at this point in the history
  • Loading branch information
akochari committed Jun 18, 2024
1 parent 38b8fb8 commit 61542be
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 26 deletions.
63 changes: 48 additions & 15 deletions FF2024/document.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,64 @@
<p><a href="index.html">Hands-on sessions</a> / <a href="exercise_session_2.html">Hands-on session 2</a> /</p>
<section id="upload-and-chat-about-a-document" class="level2">
<h2 class="anchored" data-anchor-id="upload-and-chat-about-a-document">Upload and chat about a document</h2>
<p>One use case of LLMs that has become popular is providing a document (for example, a PDF file) and chatting with LLMs about the content. For example, you can ask it to summarize, answer specific questions, find weaknesses and strengths, rewrite sections, and so on.</p>
<p>One use case of LLMs that has become popular is providing a document (for example, a PDF file) and chatting with LLMs about the content. An alternative that will work with some of the LLM tools is providing a link to the document instead of uploading it.</p>
<section id="document-upload" class="level5">
<h5 class="anchored" data-anchor-id="document-upload">Document upload</h5>
<p>If you have access to Microsoft Copilot via your university then you can simply use the upload function in the chat to upload a PDF file and then ask it to answer questions.</p>
<p>There is a number of free alternatives that you can find online. One of those is <a href="https://www.chatpdf.com/">https://www.chatpdf.com/</a>. You simply upload your PDF document here and start asking questions. One nice feature of this tool is that it tells you where it found the answer to your question.</p>
<blockquote class="blockquote">
<p>☝️ <strong>TIP</strong>: You can upload a document in Swedish but ask questions in English and vice versa because the LLM can just translate between them.</p>
</blockquote>
<blockquote class="blockquote">
<p>☝️ <strong>TIP</strong>: If you run into a file size limitation on Microsoft Copilot, try the free alternative https://chatpdf.com/.</p>
</blockquote>
</section>
<section id="example-documents" class="level5">
<h5 class="anchored" data-anchor-id="example-documents">Example documents</h5>
<p>In order to test this out you can use your own document or download one of our suggestions:</p>
<ul>
<li><a href="https://www.scilifelab.se/wp-content/uploads/2020/05/scilifelab-roadmap-2020-2030_final.pdf">SciLifeLab Roadmap for 2020-2030</a>;</li>
<li><a href="https://www.scilifelab.se/wp-content/uploads/2024/02/SciLifeLab-arsrapport-2023.pdf">SciLifeLab annual report 2023</a>;</li>
<li><a href="https://www.pnas.org/doi/pdf/10.1073/pnas.2216216120?download=true">Antibiotic perseverance increases the risk of resistance development (Brandis, Larsson, Elf, <em>PNAS 2023</em>)</a>.</li>
</ul>
<blockquote class="blockquote">
<p>☝️ <strong>TIP</strong>: You can upload a document in Swedish but ask questions in English and vice versa because the LLM can just translate between them.</p>
</blockquote>
<section id="microsoft-copilot" class="level3">
<h3 class="anchored" data-anchor-id="microsoft-copilot">Microsoft Copilot</h3>
<p>If you have access to Microsoft Copilot via your university then you can simply use the upload function in the chat to upload a PDF file and then ask it to answer questions.</p>
</section>
<section id="asking-for-information-from-the-document" class="level3">
<h3 class="anchored" data-anchor-id="asking-for-information-from-the-document">Asking for information from the document</h3>
<p>For example, we can upload the SciLifeLab annual report 2023 and ask the following.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>I am uploading a PDF file. Summarize the content.</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>What was the total budget of SciLifeLab <span class="cf">in</span> <span class="dv">2023</span>?</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="cell">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>Create an executive summary</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="cell">
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>Suggest improvements</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="reviewing-a-paper" class="level3">
<h3 class="anchored" data-anchor-id="reviewing-a-paper">Reviewing a paper</h3>
<p>One use case is to ask to use LLMs as a tool to help review your texts.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>Act as a tired, critical reviewer who looks <span class="cf">for</span> reasons to deduct points from a grant application. Read and criticize the following manuscript<span class="sc">:</span> https<span class="sc">:</span><span class="er">//</span>www.medrxiv.org<span class="sc">/</span>content<span class="sc">/</span><span class="fl">10.1101</span><span class="sc">/</span><span class="dv">2024</span>.<span class="dv">03</span>.<span class="fl">01.24303566</span>v1&nbsp;</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<blockquote class="blockquote">
<p>☝️ <strong>TIP</strong>: If you run into a file size limitation, try the free alternative that we suggest below.</p>
</blockquote>
</section>
<section id="free-alternatives" class="level3">
<h3 class="anchored" data-anchor-id="free-alternatives">Free alternatives</h3>
<p>There is a number of free alternatives that you can find online. One of those is <a href="https://www.chatpdf.com/">https://www.chatpdf.com/</a>. You simply upload your PDF document here and start asking questions. One nice feature of this tool is that it tells you where it found the answer to your question. For example, I uploaded the SciLifeLab annual report 2023 and asked the following.</p>
<section id="summarizing-documents" class="level3">
<h3 class="anchored" data-anchor-id="summarizing-documents">Summarizing documents</h3>
<div class="cell">
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>Summarize the article at https<span class="sc">:</span><span class="er">//</span>journals.plos.org<span class="sc">/</span>ploscompbiol<span class="sc">/</span>article?id<span class="ot">=</span><span class="fl">10.1371</span><span class="sc">/</span>journal.pcbi<span class="fl">.1011323</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="cell">
<div class="sourceCode cell-code" id="cb6"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>List three shortcomings of the paper</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="finding-articles" class="level3">
<h3 class="anchored" data-anchor-id="finding-articles">Finding articles</h3>
<p>In our experience these prompts work particularly well in Microsoft Copilot and Perplexity.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb7"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>Give me one reference to a scientific paper that supports the hypothesis that imatinib is useful <span class="cf">for</span> treating diabetes, and another reference that it is not useful <span class="cf">for</span> diabetes</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="cell">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>What was the total budget of SciLifeLab <span class="cf">in</span> <span class="dv">2023</span>?</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode cell-code" id="cb8"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>Redo but only clinical studies</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
</section>
Expand Down
56 changes: 47 additions & 9 deletions FF2024/document.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,68 @@ execute:

## Upload and chat about a document

One use case of LLMs that has become popular is providing a document (for example, a PDF file) and chatting with LLMs about the content. For example, you can ask it to summarize, answer specific questions, find weaknesses and strengths, rewrite sections, and so on.
One use case of LLMs that has become popular is providing a document (for example, a PDF file) and chatting with LLMs about the content. An alternative that will work with some of the LLM tools is providing a link to the document instead of uploading it.

##### Document upload

If you have access to Microsoft Copilot via your university then you can simply use the upload function in the chat to upload a PDF file and then ask it to answer questions.

There is a number of free alternatives that you can find online. One of those is <a href="https://www.chatpdf.com/">https://www.chatpdf.com/</a>. You simply upload your PDF document here and start asking questions. One nice feature of this tool is that it tells you where it found the answer to your question.

> ☝️ **TIP**: You can upload a document in Swedish but ask questions in English and vice versa because the LLM can just translate between them.
> ☝️ **TIP**: If you run into a file size limitation on Microsoft Copilot, try the free alternative https://chatpdf.com/.
##### Example documents

In order to test this out you can use your own document or download one of our suggestions:

- <a href="https://www.scilifelab.se/wp-content/uploads/2020/05/scilifelab-roadmap-2020-2030_final.pdf">SciLifeLab Roadmap for 2020-2030</a>;
- <a href="https://www.scilifelab.se/wp-content/uploads/2024/02/SciLifeLab-arsrapport-2023.pdf">SciLifeLab annual report 2023</a>;
- [Antibiotic perseverance increases the risk of resistance development (Brandis, Larsson, Elf, *PNAS 2023*)](https://www.pnas.org/doi/pdf/10.1073/pnas.2216216120?download=true).

> ☝️ **TIP**: You can upload a document in Swedish but ask questions in English and vice versa because the LLM can just translate between them.
### Asking for information from the document

### Microsoft Copilot
For example, we can upload the SciLifeLab annual report 2023 and ask the following.

If you have access to Microsoft Copilot via your university then you can simply use the upload function in the chat to upload a PDF file and then ask it to answer questions.
```{r}
What was the total budget of SciLifeLab in 2023?
```

```{r}
I am uploading a PDF file. Summarize the content.
Create an executive summary
```

> ☝️ **TIP**: If you run into a file size limitation, try the free alternative that we suggest below.
```{r}
Suggest improvements
```

### Free alternatives
### Reviewing a paper

There is a number of free alternatives that you can find online. One of those is <a href="https://www.chatpdf.com/">https://www.chatpdf.com/</a>. You simply upload your PDF document here and start asking questions. One nice feature of this tool is that it tells you where it found the answer to your question. For example, I uploaded the SciLifeLab annual report 2023 and asked the following.
One use case is to ask to use LLMs as a tool to help review your texts.

```{r}
What was the total budget of SciLifeLab in 2023?
Act as a tired, critical reviewer who looks for reasons to deduct points from a grant application. Read and criticize the following manuscript: https://www.medrxiv.org/content/10.1101/2024.03.01.24303566v1 
```

### Summarizing documents

```{r}
Summarize the article at https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1011323
```

```{r}
List three shortcomings of the paper
```

### Finding articles

In our experience these prompts work particularly well in Microsoft Copilot and Perplexity.

```{r}
Give me one reference to a scientific paper that supports the hypothesis that imatinib is useful for treating diabetes, and another reference that it is not useful for diabetes
```

```{r}
Redo but only clinical studies
```
1 change: 1 addition & 0 deletions FF2024/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ <h2 class="anchored" data-anchor-id="preparation">Preparation</h2>
<li>Umeå University: <a href="https://manual.its.umu.se/en/how-to-use-bing-chat/">Instructions for access to Microsoft Copilot</a></li>
<li>University of Gothenburg: <a href="https://studentportal.gu.se/en/news/you-can-now-login-with-your-student-account-to-use-copilot-with-bing">Instructions for access to Microsoft Copilot</a></li>
<li>Uppsala University: <a href="https://www.uu.se/en/staff/service-and-tools/tools-and-guides/generate-and-process-texts-and-images-using-ai/log-in-to-copilot">Instructions for access to Microsoft Copilot</a></li>
<li>Örebro University: no LLM available, use ChatGPT, Mistral or another.</li>
</ul>
</section>
<section id="hands-on-sessions" class="level2">
Expand Down
1 change: 1 addition & 0 deletions FF2024/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Select your university for instructions on how to access Microsoft Copilot:
- Umeå University: [Instructions for access to Microsoft Copilot](https://manual.its.umu.se/en/how-to-use-bing-chat/)
- University of Gothenburg: [Instructions for access to Microsoft Copilot](https://studentportal.gu.se/en/news/you-can-now-login-with-your-student-account-to-use-copilot-with-bing)
- Uppsala University: [Instructions for access to Microsoft Copilot](https://www.uu.se/en/staff/service-and-tools/tools-and-guides/generate-and-process-texts-and-images-using-ai/log-in-to-copilot)
- Örebro University: no LLM available, use ChatGPT, Mistral or another.

## Hands-on sessions

Expand Down
2 changes: 1 addition & 1 deletion FF2024/text.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h3 class="anchored" data-anchor-id="answering-emails-answer-politely-no">Answer
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>Create a polite response no</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="cell">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>Say no and make sure they don’t ask you again</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>Say no and make sure they don’t ask me again</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="cell">
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>Say no as a haiku</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
Expand Down
2 changes: 1 addition & 1 deletion FF2024/text.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Create a polite response no
```

```{r}
Say no and make sure they don’t ask you again
Say no and make sure they don’t ask me again
```

```{r}
Expand Down

0 comments on commit 61542be

Please sign in to comment.