Skip to content

Commit

Permalink
Add some examples
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Feb 2, 2024
1 parent 34c08ae commit cffbcf4
Show file tree
Hide file tree
Showing 2 changed files with 4,371 additions and 2 deletions.
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,40 @@ the [`lexica/`](lexica/) folder including:
2. [Diseases, conditions, and other phenotypes](lexica/phenotype)
3. [Anatomical terms, tissues, organ systems, etc.](lexica/anatomy)

## Getting Started

Load a pre-defined grounder like this:

```python
import biolexica

grounder = biolexica.load_grounder("phenotype")
>>> grounder.get_best_match("Alzheimer's disease")
Match(reference=Reference(prefix='doid', identifier='10652'), name="Alzheimer's disease", score=0.7777777777777778)
```

Note: Biolexica constructs extended version of `gilda.Grounder` that has convenience functions and a more
simple match data model encoded with Pydantic.

Search PubMed for abstracts and annotate them using a given grounder with:

```python
import biolexica
from biolexica.literature import annotate_abstracts_from_search

grounder = biolexica.load_grounder("phenotype")
pubmed_query = "alzheimer's disease"
annotations = annotate_abstracts_from_search(pubmed_query, grounder=grounder, limit=30)
```

## 🚀 Installation

<!-- Uncomment this section after your first ``tox -e finish``
The most recent release can be installed from
[PyPI](https://pypi.org/project/biolexica/) with:

```shell
pip install biolexica
```
-->

The most recent code and data can be installed directly from GitHub with:

Expand Down
Loading

0 comments on commit cffbcf4

Please sign in to comment.