xdawang commited on
Commit
ee550b2
·
verified ·
1 Parent(s): 4769ce6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -4
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 SequenceTagger
16
 
17
  # load tagger
18
- tagger = SequenceTagger.load("hunflair/hunflair2-ner")
19
 
20
  # make example sentence
21
- sentence = Sentence("On September 1st George won 1 dollar while watching Game of Thrones.")
 
 
 
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)