Add model trained with Flair
Browse files- README.md +26 -0
- pytorch_model.bin +3 -0
README.md
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- flair
|
4 |
+
- token-classification
|
5 |
+
- sequence-tagger-model
|
6 |
+
---
|
7 |
+
### Demo: How to use in Flair
|
8 |
+
Requires:
|
9 |
+
- **[Flair](https://github.com/flairNLP/flair/)** (`pip install flair`)
|
10 |
+
```python
|
11 |
+
from flair.data import Sentence
|
12 |
+
from flair.models import SequenceTagger
|
13 |
+
# load tagger
|
14 |
+
tagger = SequenceTagger.load("GuiGel/meddocan-flair-we-lstm-crf")
|
15 |
+
# make example sentence
|
16 |
+
sentence = Sentence("On September 1st George won 1 dollar while watching Game of Thrones.")
|
17 |
+
# predict NER tags
|
18 |
+
tagger.predict(sentence)
|
19 |
+
# print sentence
|
20 |
+
print(sentence)
|
21 |
+
# print predicted NER spans
|
22 |
+
print('The following NER tags are found:')
|
23 |
+
# iterate over entities and print
|
24 |
+
for entity in sentence.get_spans('ner'):
|
25 |
+
print(entity)
|
26 |
+
```
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7e1f97756dfcdca3d406daecb5daa9bf5b136719498694b96a65fe8d333edcf0
|
3 |
+
size 1460242705
|