Link to MultiNERD and warning
Browse files
README.md
CHANGED
@@ -13,7 +13,7 @@ widget:
|
|
13 |
example_title: "Spanish"
|
14 |
- text: "Amelia Earhart flew her single engine Lockheed Vega 5B across the Atlantic to Paris ."
|
15 |
example_title: "English"
|
16 |
-
- text: "Amelia Earthart a fait voler son monomoteur Lockheed Vega 5B à travers l'ocean Atlantique jusqu'à Paris ."
|
17 |
example_title: "French"
|
18 |
- text: "Amelia Earthart flog mit ihrer einmotorigen Lockheed Vega 5B über den Atlantik nach Paris ."
|
19 |
example_title: "German"
|
@@ -60,7 +60,7 @@ metrics:
|
|
60 |
|
61 |
# SpanMarker for Named Entity Recognition
|
62 |
|
63 |
-
This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model that can be used for Named Entity Recognition. In particular, this SpanMarker model uses [xlm-roberta-base](https://huggingface.co/xlm-roberta-base) as the underlying encoder. See [train.py](train.py) for the training script.
|
64 |
|
65 |
## Metrics
|
66 |
|
@@ -117,4 +117,17 @@ model = SpanMarkerModel.from_pretrained("tomaarsen/span-marker-xlm-roberta-base-
|
|
117 |
entities = model.predict("Amelia Earhart flew her single engine Lockheed Vega 5B across the Atlantic to Paris.")
|
118 |
```
|
119 |
|
120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
example_title: "Spanish"
|
14 |
- text: "Amelia Earhart flew her single engine Lockheed Vega 5B across the Atlantic to Paris ."
|
15 |
example_title: "English"
|
16 |
+
- text: "Amelia Earthart a fait voler son monomoteur Lockheed Vega 5B à travers l' ocean Atlantique jusqu'à Paris ."
|
17 |
example_title: "French"
|
18 |
- text: "Amelia Earthart flog mit ihrer einmotorigen Lockheed Vega 5B über den Atlantik nach Paris ."
|
19 |
example_title: "German"
|
|
|
60 |
|
61 |
# SpanMarker for Named Entity Recognition
|
62 |
|
63 |
+
This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model that can be used for multilingual Named Entity Recognition trained on the [MultiNERD](https://huggingface.co/datasets/Babelscape/multinerd) dataset. In particular, this SpanMarker model uses [xlm-roberta-base](https://huggingface.co/xlm-roberta-base) as the underlying encoder. See [train.py](train.py) for the training script.
|
64 |
|
65 |
## Metrics
|
66 |
|
|
|
117 |
entities = model.predict("Amelia Earhart flew her single engine Lockheed Vega 5B across the Atlantic to Paris.")
|
118 |
```
|
119 |
|
120 |
+
|
121 |
+
**Warning**: This model works best when punctuation is separated from the prior words, so
|
122 |
+
```python
|
123 |
+
# ✅
|
124 |
+
model.predict("He plays J. Robert Oppenheimer , an American theoretical physicist .")
|
125 |
+
# ❌
|
126 |
+
model.predict("He plays J. Robert Oppenheimer, an American theoretical physicist.")
|
127 |
+
|
128 |
+
# You can also supply a list of words directly: ✅
|
129 |
+
model.predict(["He", "plays", "J.", "Robert", "Oppenheimer", ",", "an", "American", "theoretical", "physicist", "."])
|
130 |
+
```
|
131 |
+
The same may be beneficial for some languages, such as splitting `"l'ocean Atlantique"` into `"l' ocean Atlantique"`.
|
132 |
+
|
133 |
+
See the [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) repository for documentation and additional information on this library.
|