Update README.md
Browse files
README.md
CHANGED
@@ -8,17 +8,20 @@ tags:
|
|
8 |
### Demo: How to use in Flair
|
9 |
|
10 |
Requires:
|
11 |
-
- **[Flair](https://github.com/flairNLP/flair/)** (`pip install flair`)
|
12 |
|
13 |
```python
|
14 |
from flair.data import Sentence
|
15 |
-
from flair.models import
|
16 |
|
17 |
# load tagger
|
18 |
-
tagger =
|
19 |
|
20 |
# make example sentence
|
21 |
-
sentence = Sentence("
|
|
|
|
|
|
|
22 |
|
23 |
# predict NER tags
|
24 |
tagger.predict(sentence)
|
|
|
8 |
### Demo: How to use in Flair
|
9 |
|
10 |
Requires:
|
11 |
+
- **[Flair](https://github.com/flairNLP/flair/)>=0.14.0** (`pip install flair` or `pip install git+https://github.com/flairNLP/flair.git`)
|
12 |
|
13 |
```python
|
14 |
from flair.data import Sentence
|
15 |
+
from flair.models import PrefixedSequenceTagger
|
16 |
|
17 |
# load tagger
|
18 |
+
tagger = PrefixedSequenceTagger.load("hunflair/hunflair2-ner")
|
19 |
|
20 |
# make example sentence
|
21 |
+
sentence = Sentence("The mutation in the ABCD1 gene causes X-linked adrenoleukodystrophy, "
|
22 |
+
"a neurodegenerative disease, which is exacerbated by exposure to high "
|
23 |
+
"levels of mercury in dolphin populations.",
|
24 |
+
use_tokenizer=SciSpacyTokenizer())
|
25 |
|
26 |
# predict NER tags
|
27 |
tagger.predict(sentence)
|