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/beto-uncased-flert-lstm-crf-meddocan")
|
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:4fdcb18b1f2753dbd2c08544f08abb26996cb229ea861d3f119dd7c0d26e4101
|
3 |
+
size 455155659
|