Update README.md
Browse files
README.md
CHANGED
@@ -12,30 +12,35 @@ widget:
|
|
12 |
|
13 |
## Swedish NER in Flair (SUC 3.0)
|
14 |
F1-Score: **85.6** (SUC 3.0)
|
15 |
-
|
16 |
Predicts 8 tags:
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
20 |
| ORG | organisation name|
|
21 |
| TME | time unit |
|
22 |
| WRK | building name |
|
23 |
| LOC | location name |
|
24 |
| EVN | event name |
|
25 |
| MSR | measurement unit |
|
26 |
-
| OBJ | object |
|
27 |
|
28 |
Based on [Flair embeddings](https://www.aclweb.org/anthology/C18-1139/) and LSTM-CRF.
|
|
|
29 |
---
|
|
|
30 |
### Demo: How to use in Flair
|
|
|
31 |
Requires: **[Flair](https://github.com/flairNLP/flair/)** (`pip install flair`)
|
|
|
32 |
```python
|
33 |
from flair.data import Sentence
|
34 |
from flair.models import SequenceTagger
|
35 |
# load tagger
|
36 |
tagger = SequenceTagger.load("flair/ner-english-ontonotes-large")
|
37 |
# make example sentence
|
38 |
-
sentence = Sentence(
|
39 |
# predict NER tags
|
40 |
tagger.predict(sentence)
|
41 |
# print sentence
|
@@ -48,8 +53,13 @@ for entity in sentence.get_spans('ner'):
|
|
48 |
```
|
49 |
This yields the following output:
|
50 |
```
|
51 |
-
|
|
|
|
|
52 |
```
|
53 |
-
|
|
|
|
|
54 |
---
|
55 |
-
|
|
|
|
12 |
|
13 |
## Swedish NER in Flair (SUC 3.0)
|
14 |
F1-Score: **85.6** (SUC 3.0)
|
15 |
+
|
16 |
Predicts 8 tags:
|
17 |
+
|
18 |
+
|**Tag**|**Meaning**|
|
19 |
+
|---|---|
|
20 |
+
| PRS| person name |
|
21 |
| ORG | organisation name|
|
22 |
| TME | time unit |
|
23 |
| WRK | building name |
|
24 |
| LOC | location name |
|
25 |
| EVN | event name |
|
26 |
| MSR | measurement unit |
|
27 |
+
| OBJ | object (like "Rolls-Royce" is a object in the form of a special car) |
|
28 |
|
29 |
Based on [Flair embeddings](https://www.aclweb.org/anthology/C18-1139/) and LSTM-CRF.
|
30 |
+
|
31 |
---
|
32 |
+
|
33 |
### Demo: How to use in Flair
|
34 |
+
|
35 |
Requires: **[Flair](https://github.com/flairNLP/flair/)** (`pip install flair`)
|
36 |
+
|
37 |
```python
|
38 |
from flair.data import Sentence
|
39 |
from flair.models import SequenceTagger
|
40 |
# load tagger
|
41 |
tagger = SequenceTagger.load("flair/ner-english-ontonotes-large")
|
42 |
# make example sentence
|
43 |
+
sentence = Sentence("Hampus Londögård bor i Lund och har levererat denna model idag.")
|
44 |
# predict NER tags
|
45 |
tagger.predict(sentence)
|
46 |
# print sentence
|
|
|
53 |
```
|
54 |
This yields the following output:
|
55 |
```
|
56 |
+
Span [0,1]: "Hampus Londögård" [− Labels: PRS (1.0)]
|
57 |
+
Span [4]: "Lund" [− Labels: LOC (1.0)]
|
58 |
+
Span [10]: "idag" [− Labels: TME(1.0)]
|
59 |
```
|
60 |
+
|
61 |
+
So, the entities "_Hampus Londögård_" (labeled as a **PRS**), "_Lund_" (labeled as a **LOC**), "_idag_" (labeled as a **TME**) are found in the sentence "_Hampus Londögård bor i Lund och har levererat denna model idag._".
|
62 |
+
|
63 |
---
|
64 |
+
|
65 |
+
**Please mention londogard if using this models.**
|