initial model commit
Browse files
README.md
CHANGED
|
@@ -13,7 +13,7 @@ inference: false
|
|
| 13 |
|
| 14 |
This is the fast phrase chunking model for English that ships with [Flair](https://github.com/flairNLP/flair/).
|
| 15 |
|
| 16 |
-
F1-Score: **96,
|
| 17 |
|
| 18 |
Predicts 4 tags:
|
| 19 |
|
|
@@ -43,7 +43,7 @@ from flair.data import Sentence
|
|
| 43 |
from flair.models import SequenceTagger
|
| 44 |
|
| 45 |
# load tagger
|
| 46 |
-
tagger = SequenceTagger.load("flair/chunk-english")
|
| 47 |
|
| 48 |
# make example sentence
|
| 49 |
sentence = Sentence("The happy man has been eating at the diner")
|
|
@@ -98,10 +98,10 @@ tag_dictionary = corpus.make_tag_dictionary(tag_type=tag_type)
|
|
| 98 |
embedding_types = [
|
| 99 |
|
| 100 |
# contextual string embeddings, forward
|
| 101 |
-
FlairEmbeddings('news-forward'),
|
| 102 |
|
| 103 |
# contextual string embeddings, backward
|
| 104 |
-
FlairEmbeddings('news-backward'),
|
| 105 |
]
|
| 106 |
|
| 107 |
# embedding stack consists of Flair and GloVe embeddings
|
|
@@ -121,7 +121,7 @@ from flair.trainers import ModelTrainer
|
|
| 121 |
trainer = ModelTrainer(tagger, corpus)
|
| 122 |
|
| 123 |
# 7. run training
|
| 124 |
-
trainer.train('resources/taggers/chunk-english',
|
| 125 |
train_with_dev=True,
|
| 126 |
max_epochs=150)
|
| 127 |
```
|
|
|
|
| 13 |
|
| 14 |
This is the fast phrase chunking model for English that ships with [Flair](https://github.com/flairNLP/flair/).
|
| 15 |
|
| 16 |
+
F1-Score: **96,22** (corrected CoNLL-2000)
|
| 17 |
|
| 18 |
Predicts 4 tags:
|
| 19 |
|
|
|
|
| 43 |
from flair.models import SequenceTagger
|
| 44 |
|
| 45 |
# load tagger
|
| 46 |
+
tagger = SequenceTagger.load("flair/chunk-english-fast")
|
| 47 |
|
| 48 |
# make example sentence
|
| 49 |
sentence = Sentence("The happy man has been eating at the diner")
|
|
|
|
| 98 |
embedding_types = [
|
| 99 |
|
| 100 |
# contextual string embeddings, forward
|
| 101 |
+
FlairEmbeddings('news-forward-fast'),
|
| 102 |
|
| 103 |
# contextual string embeddings, backward
|
| 104 |
+
FlairEmbeddings('news-backward-fast'),
|
| 105 |
]
|
| 106 |
|
| 107 |
# embedding stack consists of Flair and GloVe embeddings
|
|
|
|
| 121 |
trainer = ModelTrainer(tagger, corpus)
|
| 122 |
|
| 123 |
# 7. run training
|
| 124 |
+
trainer.train('resources/taggers/chunk-english-fast',
|
| 125 |
train_with_dev=True,
|
| 126 |
max_epochs=150)
|
| 127 |
```
|