Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
phlobo authored Jul 12, 2024
1 parent daae6e7 commit 15953b6
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,10 @@ dataset = load_dataset("distemist", "distemist_linking_bigbio_kb")

To use xMEN with existing NER pipelines, you can also create a dataset at runtime.

#### [spaCy](https://spacy.io/)

```python
from xmen.data import from_spacy
docs = ... # list of spaCy docs with entity spans
dataset = from_spacy(docs)
```
#### Span-based Formats

for an example, see: [examples/02_spaCy_German.ipynb](examples/02_spaCy_German.ipynb)

#### [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER)
Any span-based annotation format (e.g., based on character offsets), can be converted to a xMEN-compatible dataset.
For instance, using [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) predictions:

```python
from span_marker import SpanMarkerModel
Expand All @@ -62,6 +55,17 @@ from xmen.data import from_spans
dataset = from_spans(preds, sentences)
```

#### [spaCy](https://spacy.io/)

```python
from xmen.data import from_spacy
docs = ... # list of spaCy docs with entity spans
dataset = from_spacy(docs)
```

for an example, see: [examples/02_spaCy_German.ipynb](examples/02_spaCy_German.ipynb)


## 🔧 Configuration and CLI

xMEN provides a convenient command line interface to prepare entity linking pipelines by creating target dictionaries and pre-computing indices to link to concepts in them.
Expand Down

0 comments on commit 15953b6

Please sign in to comment.