A container for neuron entity linking in the VFB related publications.
1.9K
A repository to link neuron names/mentions that exist in the publications with the FBBT Ontology terms.
This project works in collaboration with europmc_crawler to retrieve publication contents from the Europe PMC. /data folder provides sample output of the europmc_crawler
Used terminology is as follows:
Mention: A noun or noun phrase in the publication (such as MP1) to search for the related entities in the ontology (adult Drosulfakinin MP1 neuron, FBbt:00051431).
Entity linking candidate: For evey mention a set of ontology term nominees with different confidence scores are calculated. Each nominee is called an entity linking candidate.
Publication content represented in tabular format (see /data folder) is processed in batches using SciSpacy.
A confidence threshold (0.85) is applied to filter low confidence candidates.
Mentions that exist in the stopwords (resources/stopwords.txt) are filtered.
Additionally, for every mention a relative threshold based filtering is applied. Candidates that are significantly lower than the most confident candidate are filtered.
Mentions shorter than 4 letters must exist in the ontology term's label or synonyms.
Not frequent entities (linked less than 3 times) are filtered
For each paper, specimen term ('male', 'female', 'larval') frequencies are calculated. Candidates whose specimen not mentioned in the paper are filtered (adult corazonin neuron vs larval corazonin neuron).
Outlier detection is applied to all linking results:
Finally, ROBOT templates for the publication metadata and entity linking results are generated in the /robot_templates folder.
Project uses SciSpacy and OWL2Vec* for entity linking and results' filtering (outlier detection). Pre-trained models for both can be found at:
In case the FBBT ontology change, these models need to be retrained following the given steps:
1- SciSpacy requires a json representation of the ontology, generate it through running:
python src/owl_to_json.py
This script only transforms the subclasses of the neuron class (FBbt:00005106) and generates the fbbt-cedar.jsonl
During this transformation a set of steps are applied to entity labels and synonyms to enrich aliases and generate new ones: 1. Texts inside parentheses are removed 1. '-' replaced by ' ' 1. Ignored words (eg. neuron, secondary etc.) cleaned to increase match 1. Plural and singular variations of 'neuron' 1. Greek letters replaced by their symbol (alpha -> α)
2- Run SciSpacy model trainer:
python src/train_fbbt_linker.py
3- Run OWL2Vec* trainer:
python semantics/OWL2Vec_Standalone.py
This step uses the /owl2vec/default.cfg configuration file.
To run the project, build the Docker image and run with the required environment variables
docker build -t virtualflybrain/neuron-to-paper-nlp .
docker run --volume=/home/my/volume:/my_volume/ -e DATA_FOLDER=/my_volume/data -e OUTPUT_FOLDER=/my_volume/output -e ONTOLOGY_FOLDER=/my_volume/ontology virtualflybrain/neuron-to-paper-nlp:latest
Project requires python >=3.7, <3.9 venv, due to dependencies of the OWL2Vec*
Create virtual environment for this project. Then install the following dependencies:
pip install https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.5.0/en_core_sci_sm-0.5.0.tar.gz
pip install -r requirements.txt
Run main.py to test the model with the sample data in the data folder. Linking results are generated in the output folder.
Project uses a manually annotated corpus (/evaluation) to evaluate the accuracy of the system. To evaluate the tool, run:
python src/evaluation.py
Tester runs the tool and compares the generated entity linking results with the expected ones through calculating FN, TP, FP, precision, recall and F1.
Content type
Image
Digest
sha256:9ca4ed695…
Size
1.3 GB
Last updated
about 3 years ago
docker pull virtualflybrain/neuron-to-paper-nlp