# Loading paper text

ICE has built-in functionality for parsing and loading papers, and includes [some example papers](https://github.com/oughtinc/ice/tree/main/papers) that you can download. Here’s a minimal recipe that loads a paper and prints out the first paragraph (often the abstract):

{% code title="paper\_hello.py" %}

```python
from ice.paper import Paper
from ice.recipe import recipe


async def answer_for_paper(paper: Paper):
    return paper.paragraphs[0]


recipe.main(answer_for_paper)
```

{% endcode %}

You can run the recipe as follows, providing the path to the downloaded paper as a keyword argument:

```shell
python paper_hello.py --paper path_to_downloaded_paper/keenan-2018.pdf
```

You’ll see a result like this:

{% code overflow="wrap" %}

```python
Paragraph(sentences=['We hypothesized that mass distribution of a broad-spectrum antibiotic agent to preschool children would reduce mortality in areas of sub-Saharan Africa that are currently far from meeting the Sustainable Development Goals of the United Nations.'], sections=[Section(title='Abstract', number=None)], section_type='abstract')
```

{% endcode %}

Note that:

* Papers are represented as lists of paragraphs.
* Paragraphs are represented as lists of sentences.
* Each paragraph has information about which section it’s from.

Try it with your own PDF papers!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://primer.ought.org/chapters/long-texts/loading-paper-text.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
