{"id":21171646,"url":"https://github.com/anthonymrios/pymetamap","last_synced_at":"2025-10-24T03:13:13.133Z","repository":{"id":26016232,"uuid":"29458903","full_name":"AnthonyMRios/pymetamap","owner":"AnthonyMRios","description":"Python wraper for MetaMap","archived":false,"fork":false,"pushed_at":"2020-07-22T19:58:16.000Z","size":47,"stargazers_count":168,"open_issues_count":12,"forks_count":61,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-26T14:45:03.759Z","etag":null,"topics":["biomedical-informatics","named-entity-recognition","natural-language-processing","nlp","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnthonyMRios.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-2.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-19T07:26:26.000Z","updated_at":"2024-04-14T15:00:43.000Z","dependencies_parsed_at":"2022-08-28T21:02:18.751Z","dependency_job_id":null,"html_url":"https://github.com/AnthonyMRios/pymetamap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnthonyMRios%2Fpymetamap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnthonyMRios%2Fpymetamap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnthonyMRios%2Fpymetamap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnthonyMRios%2Fpymetamap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnthonyMRios","download_url":"https://codeload.github.com/AnthonyMRios/pymetamap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601449,"owners_count":20964864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["biomedical-informatics","named-entity-recognition","natural-language-processing","nlp","python"],"created_at":"2024-11-20T16:09:27.888Z","updated_at":"2025-10-24T03:13:13.015Z","avatar_url":"https://github.com/AnthonyMRios.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pymetamap\n=========\n\nPython wrapper around `MetaMap \u003chttp://metamap.nlm.nih.gov/\u003e`_.\nThis will take a list of sentences and extract concepts using MetaMap\nthen return them in the form of a list of Concept objects.\n\n**Note:** This code does **not** work with Windows because of my use of NamedTemporaryFile in SubprocessBackend.py.\n\nHow to Install\n--------------\n\nFirst, install MetaMap by using the following instructions: https://metamap.nlm.nih.gov/Installation.shtml\n\nNext, pymetamap can be installed using the following command:\n\n\u003e\u003e\u003e python setup.py install\n\nExample Usage\n-------------\n\nTo start you must create a MetaMap instance from the pymetamap package.\n\n::\n\n    \u003e\u003e\u003e from pymetamap import MetaMap\n    \u003e\u003e\u003e mm = MetaMap.get_instance('/opt/public_mm/bin/metamap12')\n\nYou must supply the metamap binary to ``get_instance()`` in order to\nextract 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.\nFor example, if you installed the 2016 version of MetaMap, then the binary will be called ``metamap16``.\n\nWe now support MetaMapLite. To use MetaMapLite, rather than MetaMap, create a MetaMapLite instance:\n\n::\n\n    \u003e\u003e\u003e from pymetamap import MetaMapLite\n    \u003e\u003e\u003e mm = MetaMapLite.get_instance('/opt/public_mm_lite_3.6.2rc3/')\n\n**Note:** The MetaMap binary path and MetaMapLite home directory should be absolute.\n\nTo extract concepts from a sentence with MetaMapLite and MetaMap use the ``extract_concepts()``\nmethod. This method takes a list of sentences as input and will return\na list of Concept objects.\n\n::\n\n    \u003e\u003e\u003e sents = ['Heart Attack', 'John had a huge heart attack']\n    \u003e\u003e\u003e concepts,error = mm.extract_concepts(sents,[1,2])\n    \u003e\u003e\u003e for concept in concepts:\n    ...     print concept\n    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')\n    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')\n\nThis example shows two separate concepts extracted via MetaMap from two\ndifferent sentences (sentence 1 and sentence 2).\n\nMore Information\n----------------\n\nLicensed under `Apache 2.0 \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e`_.\n\nWritten by Anthony Rios\n\nSpecial thanks to `joaopalotti \u003chttps://github.com/joaopalotti\u003e`_ and others for their contributions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonymrios%2Fpymetamap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanthonymrios%2Fpymetamap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonymrios%2Fpymetamap/lists"}