Update README.md
Browse files
README.md
CHANGED
@@ -7,9 +7,11 @@ language: sv
|
|
7 |
datasets:
|
8 |
- SUC 3.0
|
9 |
widget:
|
10 |
-
- text: "Hampus
|
11 |
---
|
12 |
|
|
|
|
|
13 |
## Swedish NER in Flair (SUC 3.0)
|
14 |
F1-Score: **85.6** (SUC 3.0)
|
15 |
|
@@ -38,9 +40,9 @@ Requires: **[Flair](https://github.com/flairNLP/flair/)** (`pip install flair`)
|
|
38 |
from flair.data import Sentence
|
39 |
from flair.models import SequenceTagger
|
40 |
# load tagger
|
41 |
-
tagger = SequenceTagger.load("flair
|
42 |
# make example sentence
|
43 |
-
sentence = Sentence("Hampus
|
44 |
# predict NER tags
|
45 |
tagger.predict(sentence)
|
46 |
# print sentence
|
@@ -53,12 +55,12 @@ for entity in sentence.get_spans('ner'):
|
|
53 |
```
|
54 |
This yields the following output:
|
55 |
```
|
56 |
-
Span [0
|
57 |
-
Span [
|
58 |
-
Span [
|
59 |
```
|
60 |
|
61 |
-
So, the entities "
|
62 |
|
63 |
---
|
64 |
|
|
|
7 |
datasets:
|
8 |
- SUC 3.0
|
9 |
widget:
|
10 |
+
- text: "Hampus bor i Skåne och har levererat denna model idag."
|
11 |
---
|
12 |
|
13 |
+
Published with ❤️ from [londogard](https://londogard.com).
|
14 |
+
|
15 |
## Swedish NER in Flair (SUC 3.0)
|
16 |
F1-Score: **85.6** (SUC 3.0)
|
17 |
|
|
|
40 |
from flair.data import Sentence
|
41 |
from flair.models import SequenceTagger
|
42 |
# load tagger
|
43 |
+
tagger = SequenceTagger.load("londogard/flair-swe-ner")
|
44 |
# make example sentence
|
45 |
+
sentence = Sentence("Hampus bor i Skåne och har levererat denna model idag.")
|
46 |
# predict NER tags
|
47 |
tagger.predict(sentence)
|
48 |
# print sentence
|
|
|
55 |
```
|
56 |
This yields the following output:
|
57 |
```
|
58 |
+
Span [0]: "Hampus" [− Labels: PRS (1.0)]
|
59 |
+
Span [3]: "Skåne" [− Labels: LOC (1.0)]
|
60 |
+
Span [9]: "idag" [− Labels: TME(1.0)]
|
61 |
```
|
62 |
|
63 |
+
So, the entities "_Hampus_" (labeled as a **PRS**), "_Skåne_" (labeled as a **LOC**), "_idag_" (labeled as a **TME**) are found in the sentence "_Hampus bor i Skåne och har levererat denna model idag._".
|
64 |
|
65 |
---
|
66 |
|