All Projects → AnthonyMRios → Pymetamap

AnthonyMRios / Pymetamap

Licence: apache-2.0
Python wraper for MetaMap

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pymetamap

Flair
A very simple framework for state-of-the-art Natural Language Processing (NLP)
Stars: ✭ 11,065 (+9198.32%)
Mutual labels:  natural-language-processing, named-entity-recognition
Corenlp
Stanford CoreNLP: A Java suite of core NLP tools.
Stars: ✭ 8,248 (+6831.09%)
Mutual labels:  natural-language-processing, named-entity-recognition
Deepnlp
基于深度学习的自然语言处理库
Stars: ✭ 34 (-71.43%)
Mutual labels:  natural-language-processing, named-entity-recognition
Danlp
DaNLP is a repository for Natural Language Processing resources for the Danish Language.
Stars: ✭ 111 (-6.72%)
Mutual labels:  natural-language-processing, named-entity-recognition
Bond
BOND: BERT-Assisted Open-Domain Name Entity Recognition with Distant Supervision
Stars: ✭ 96 (-19.33%)
Mutual labels:  natural-language-processing, named-entity-recognition
Entity Recognition Datasets
A collection of corpora for named entity recognition (NER) and entity recognition tasks. These annotated datasets cover a variety of languages, domains and entity types.
Stars: ✭ 891 (+648.74%)
Mutual labels:  natural-language-processing, named-entity-recognition
Nagisa Tutorial Pycon2019
Code for PyCon JP 2019 talk "Python による日本語自然言語処理 〜系列ラベリングによる実世界テキスト分析〜"
Stars: ✭ 46 (-61.34%)
Mutual labels:  natural-language-processing, named-entity-recognition
Seqeval
A Python framework for sequence labeling evaluation(named-entity recognition, pos tagging, etc...)
Stars: ✭ 508 (+326.89%)
Mutual labels:  natural-language-processing, named-entity-recognition
Turkish Bert Nlp Pipeline
Bert-base NLP pipeline for Turkish, Ner, Sentiment Analysis, Question Answering etc.
Stars: ✭ 85 (-28.57%)
Mutual labels:  natural-language-processing, named-entity-recognition
Nested Ner Tacl2020 Transformers
Implementation of Nested Named Entity Recognition using BERT
Stars: ✭ 76 (-36.13%)
Mutual labels:  natural-language-processing, named-entity-recognition
Stanza
Official Stanford NLP Python Library for Many Human Languages
Stars: ✭ 5,887 (+4847.06%)
Mutual labels:  natural-language-processing, named-entity-recognition
Pynlp
A pythonic wrapper for Stanford CoreNLP.
Stars: ✭ 103 (-13.45%)
Mutual labels:  natural-language-processing, named-entity-recognition
Hanlp
中文分词 词性标注 命名实体识别 依存句法分析 成分句法分析 语义依存分析 语义角色标注 指代消解 风格转换 语义相似度 新词发现 关键词短语提取 自动摘要 文本分类聚类 拼音简繁转换 自然语言处理
Stars: ✭ 24,626 (+20594.12%)
Mutual labels:  natural-language-processing, named-entity-recognition
Named Entity Recognition
name entity recognition with recurrent neural network(RNN) in tensorflow
Stars: ✭ 20 (-83.19%)
Mutual labels:  natural-language-processing, named-entity-recognition
Ner Lstm
Named Entity Recognition using multilayered bidirectional LSTM
Stars: ✭ 532 (+347.06%)
Mutual labels:  natural-language-processing, named-entity-recognition
Understanding Financial Reports Using Natural Language Processing
Investigate how mutual funds leverage credit derivatives by studying their routine filings to the SEC using NLP techniques 📈🤑
Stars: ✭ 36 (-69.75%)
Mutual labels:  natural-language-processing, named-entity-recognition
Spacy
💫 Industrial-strength Natural Language Processing (NLP) in Python
Stars: ✭ 21,978 (+18368.91%)
Mutual labels:  natural-language-processing, named-entity-recognition
Awesome Persian Nlp Ir
Curated List of Persian Natural Language Processing and Information Retrieval Tools and Resources
Stars: ✭ 460 (+286.55%)
Mutual labels:  natural-language-processing, named-entity-recognition
Iob2corpus
Japanese IOB2 tagged corpus for Named Entity Recognition.
Stars: ✭ 51 (-57.14%)
Mutual labels:  natural-language-processing, named-entity-recognition
Open Semantic Entity Search Api
Open Source REST API for named entity extraction, named entity linking, named entity disambiguation, recommendation & reconciliation of entities like persons, organizations and places for (semi)automatic semantic tagging & analysis of documents by linked data knowledge graph like SKOS thesaurus, RDF ontology, database(s) or list(s) of names
Stars: ✭ 98 (-17.65%)
Mutual labels:  natural-language-processing, named-entity-recognition

pymetamap

Python wrapper around MetaMap <http://metamap.nlm.nih.gov/>_. This will take a list of sentences and extract concepts using MetaMap then return them in the form of a list of Concept objects.

Note: This code does not work with Windows because of my use of NamedTemporaryFile in SubprocessBackend.py.

How to Install

First, install MetaMap by using the following instructions: https://metamap.nlm.nih.gov/Installation.shtml

Next, pymetamap can be installed using the following command:

python setup.py install

Example Usage

To start you must create a MetaMap instance from the pymetamap package.

::

>>> from pymetamap import MetaMap
>>> mm = MetaMap.get_instance('/opt/public_mm/bin/metamap12')

You must supply the metamap binary to get_instance() in order to extract concepts. Depending on where you installed MetaMap and depending on the version you are using, you will need to change the /opt/public_mm/bin/metamap12 to the correct location. For example, if you installed the 2016 version of MetaMap, then the binary will be called metamap16.

We now support MetaMapLite. To use MetaMapLite, rather than MetaMap, create a MetaMapLite instance:

::

>>> from pymetamap import MetaMapLite
>>> mm = MetaMapLite.get_instance('/opt/public_mm_lite_3.6.2rc3/')

Note: The MetaMap binary path and MetaMapLite home directory should be absolute.

To extract concepts from a sentence with MetaMapLite and MetaMap use the extract_concepts() method. This method takes a list of sentences as input and will return a list of Concept objects.

::

>>> sents = ['Heart Attack', 'John had a huge heart attack']
>>> concepts,error = mm.extract_concepts(sents,[1,2])
>>> for concept in concepts:
...     print concept
Concept(index='1', mm='MM', score='14.64', preferred_name='Myocardial Infarction', cui='C0027051', semtypes='[dsyn]', trigger='["Heart attack"-tx-1-"Heart Attack"]', location='TX', pos_info='1:12', tree_codes='C14.280.647.500;C14.907.585.500')
Concept(index='2', mm='MM', score='13.22', preferred_name='Myocardial Infarction', cui='C0027051', semtypes='[dsyn]', trigger='["Heart attack"-tx-1-"heart attack"]', location='TX', pos_info='17:12', tree_codes='C14.280.647.500;C14.907.585.500')

This example shows two separate concepts extracted via MetaMap from two different sentences (sentence 1 and sentence 2).

More Information

Licensed under Apache 2.0 <http://www.apache.org/licenses/LICENSE-2.0>_.

Written by Anthony Rios

Special thanks to joaopalotti <https://github.com/joaopalotti>_ and others for their contributions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].