Skip to main content

use MER inside python

Project description

Use MER scripts inside python.

(from the MER repository)

MER is a Named-Entity Recognition tool which given any lexicon and any input text returns the list of terms recognized in the text, including their exact location (annotations).

Given an ontology (owl file) MER is also able to link the entities to their classes.

More information about MER can be found in:

  • MER: a Shell Script and Annotation Server for Minimal Named Entity Recognition and Linking, F. Couto and A. Lamurias, Journal of Cheminformatics, 10:58, 2018 [https://doi.org/10.1186/s13321-018-0312-9]
  • MER: a Minimal Named-Entity Recognition Tagger and Annotation Server, F. Couto, L. Campos, and A. Lamurias, in BioCreative V.5 Challenge Evaluation, 2017 [https://www.researchgate.net/publication/316545534_MER_a_Minimal_Named-Entity_Recognition_Tagger_and_Annotation_Server]

Dependencies

awk

MER was developed and tested using the GNU awk (gawk) and grep. If you have another awk interpreter in your machine, there's no assurance that the program will work.

For example, to install GNU awk on Ubuntu:

sudo apt-get install gawk

Installation

pip install merpy

or

python setup.py install

Basic Usage

>>> import merpy
>>> merpy.generate_lexicon("hp")
>>> document = 'Influenza, commonly known as "the flu", is an infectious disease caused by an influenza virus. Symptoms can be mild to severe. The most common symptoms include: a high fever, runny nose, sore throat, muscle pains, headache, coughing, and feeling tired'
>>> entities = merpy.get_entities(document, "hp")
>>> print(entities)
[['111', '115', 'mild', 'http://purl.obolibrary.org/obo/HP_0012825'], ['119', '125', 'severe', 'http://purl.obolibrary.org/obo/HP_0012828'], ['168', '173', 'fever', 'http://purl.obolibrary.org/obo/HP_0001945'], ['214', '222', 'headache', 'http://purl.obolibrary.org/obo/HP_0002315'], ['224', '232', 'coughing', 'http://purl.obolibrary.org/obo/HP_0012735'], ['246', '251', 'tired', 'http://purl.obolibrary.org/obo/HP_0012378'], ['175', '185', 'runny nose', 'http://purl.obolibrary.org/obo/HP_0031417']]
>>> lexicons = merpy.get_lexicons()
>>> merpy.show_lexicons()
lexicons preloaded:
['lexicon', 'go', 'cell_line_and_cell_type', 'chebi_lite', 'chemical', 'hp', 'disease', 'wordnet_nouns', 'hpo', 'radlex', 'doid', 'protein', 'hpomultilang', 'tissue_and_organ', 'mirna', 'subcellular_structure']

lexicons loaded ready to use:
['lexicon', 'doid', 'hp']

lexicons with linked concepts:
['doid', 'hp', 'go', 'chebi_lite', 'lexicon']

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

merpy-0.1.2.tar.gz (25.2 MB view details)

Uploaded Source

Built Distributions

merpy-0.1.2-py3.6.egg (50.5 MB view details)

Uploaded Source

merpy-0.1.2-py3-none-any.whl (50.5 MB view details)

Uploaded Python 3

File details

Details for the file merpy-0.1.2.tar.gz.

File metadata

  • Download URL: merpy-0.1.2.tar.gz
  • Upload date:
  • Size: 25.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for merpy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b72a5566453196a5d677df30a96e026be8d70fd4c00ce1bf889dfd4bdebc1f05
MD5 eda241bcb8383beeed761030a463c276
BLAKE2b-256 d5ceb2c44d815b266e1da3b619374d2e0c6011176c347c3b40cc67acb052b6d8

See more details on using hashes here.

File details

Details for the file merpy-0.1.2-py3.6.egg.

File metadata

  • Download URL: merpy-0.1.2-py3.6.egg
  • Upload date:
  • Size: 50.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for merpy-0.1.2-py3.6.egg
Algorithm Hash digest
SHA256 c276f5eb6fa31d7e76efb2f67226cbc38f432b2c322b8c4a1a45ce34c40db79b
MD5 5e267deaf209c54e063d4a314fde7007
BLAKE2b-256 d91c09e8e94908d1663b311ce171be5a73d11264acf9cad4cb99d53ec6142704

See more details on using hashes here.

File details

Details for the file merpy-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: merpy-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 50.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for merpy-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 656530014fd077f9435bde7217c60da04dbb29970e10de4e763817e6cecb01e8
MD5 95ceb32a499a1442185a2cbf5b19ad74
BLAKE2b-256 5fd1f962f77f9e09a0dc71f3fced95d18efa033fdd11b962552a62dd86a71bb0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page