Downloads · 30 days
0
finding-fossils/metaextractor-spacy
metaextractor-spacy is a token classification model from finding-fossils. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as apache-2.0.
<img src="https://huggingface.co/finding-fossils/metaextractor/resolve/main/ffossils-logo-text.png" width="400"
Downloads · 30 days
0
Access
Public
Updated Jun 26, 2023
Repo size
1 GB
Likes
0
Public
Click a slice to open those files.
Other533 MB · 52%
From the Hugging Face model README
This model extracts metadata from research articles related to Paleoecology.
The entities detected by this model are:
This model can be used to extract entities from any text that are Paeleoecology related or tangential. Potential uses include identifying unique SITE names in research papers in other domains.
This model is deployed on the xDD (formerly GeoDeepDive) servers where it is getting fed new research articles relevant to Neotoma and returning the extracted data.
This approach could be adapted to other domains by using the training and development code found github.com/NeotomaDB/MetaExtractor to run similar data extraction for other research domains.
This model was trained entirely on English research articles and will likely not perform well on research in other languages. Also, the articles used to train the model were chosen based on being already present in the Neotoma database and therefore may have selection bias as they represent what is already known to be relevant to Neotoma and may not correctly manage new, previously missed articles.
Use the code below to get started with the model.
pip install https://huggingface.co/finding-fossils/metaextractor-spacy/resolve/main/en_metaextractor_spacy-any-py3-none-any.whl
# Using spacy.load().
import spacy
nlp = spacy.load("en_metaextractor_spacy")
# Importing as module.
import en_metaextractor_spacy
ner_pipe = en_metaextractor_spacy.load()
doc = ner_pipe("In Northern Canada, the BGC site core was primarily made up of Pinus pollen.")
entities = []
for ent in doc.ents:
entities.append({
"start": ent.start_char,
"end": ent.end_char,
"labels": [ent.label_],
"text": ent.text
})
print(entities)
# Output
[
{
"start": 3,
"end": 19,
"labels": ["REGION"],
"text": " Northern Canada,",
},
{
"start": 24,
"end": 27,
"labels": ["SITE"],
"text": " BGC",
},
{
"start": 63,
"end": 68,
"labels": ["TAXA"],
"text": " Pinus",
}
]
The model was trained using a set of 39 research articles deemed relevant to the Neotoma Database. All articles were written in English. The entities were labeled by the project team along with using pre-labelling with early models to speed up the labelling process.
A 70/15/15 train/val/test split was used which had the following breakdown of words and entities.
| Train | Validation | Test | |
|---|---|---|---|
| Articles | 28 | 6 | 6 |
| Words | 220857 | 37809 | 36098 |
| TAXA Entities | 3352 | 650 | 570 |
| SITE Entities | 1228 | 177 | 219 |
| REGION Entities | 2314 | 318 | 258 |
| GEOG Entities | 188 | 37 | 8 |
| AGE Entities | 919 | 206 | 153 |
| ALTI Entities | 99 | 24 | 14 |
| Email Entities | 14 | 4 | 11 |
For full training details please see the GitHub repository and Wiki: github.com/NeotomaDB/MetaExtractor
For full model results see the report here: Final Project Report