MetaMap安装官网教程

MetaMap是一个将文本中的术语映射到UMLS元同义词典的工具,主要使用SICStus Prolog编写。要使用MetaMap Java API,需要Java 1.6及以上版本。安装包括下载、解压和运行安装脚本。在Linux上,需要运行`./bin/install.sh`。在Windows上,通过安装程序进行图形化安装。启动MetaMap服务器前,需确保SKR/Medpost Tagger运行。通过`testapi.sh`可测试API是否正常工作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

MetaMap官网的安装教程
Purpose

MetaMap maps terms occuring in text to UMLS Metathesaurus concepts. As part of this mapping process, MetaMap tokenizes text into sections, sentences, phrases, terms, and words. MetaMap maps the noun phrases of the text to the best matching UMLS concept or set of concepts that best cover each phrase. The MetaMap Java API provides java programs with programmatic access to MetaMap mapping engine.

MetaMap将文本中出现的术语映射到UMLS元同义词典概念。作为映射过程的一部分,MetaMap将文本标记为节、句子、短语、术语和单词。MetaMap将文本的名词短语映射到最匹配的UMLS概念或最适合每个短语的概念集。MetaMap Java API为Java程序提供了对MetaMap映射引擎的程序化访问。

MetaMap API's Underlying Architecture

MetaMap mapping engine is written primarily in SICStus Prolog; to facilitate its use by Java programs, the system uses PrologBeans to provide a loose coupling between the Java API and the mapping engine. See the SICStus Prolog PrologBeans documentation for more information (http://www.sics.se/sicstus/docs/latest4/html/sicstus.html/lib_002dprologbeans.html).

MetaMap地图引擎主要是用SICStus Prolog编写的;为了方便Java程序使用它,系统使用prologbean来提供Java API和映射引擎之间的松散耦合。有关更多信息,请参见SICStus Prolog PrologBeans文档

Pre-requisites

The full MetaMap download and installation is required to use the MetaMap Java API (see \http://metamap.nlm.nih.gov/#Downloads). Also, Java 1.6 SDK or greater is required. (It should work Java 1.5 but it has not been tested with Java 1.5)

安装需要MetaMap JAVA API,Java SDK版本1.6以上

Downloading, Extracting and Installing the API distribution

In the directory where you installed the Public Metamap (the directory containing the public_mm directory) extract the javaapi archive:

在安装Public Metamap的目录(包含public_mm目录的目录)中,提取javaapi存档:

$ bzip2 -dc /home/piro/public_mm_linux_javaapi_{four-digit-year}.tar.bz2 | tar xvf -

If you plan on modifying the sources to the prolog-based MetaMap server (mmserver) you will need to download and extract the source archive (http://metamap.nlm.nih.gov/download/public_mm_src_{four-digit-year}.tar.bz2) as well:

如果您计划将源代码修改为基于prolog的MetaMap服务器(mmserver),则需要下载并解压源代码存档

$ bzip2 -dc /home/piro/public_mm_src_{four-digit-year}.tar.bz2 | tar xvf -

Linux Install

You will need to re-run ./bin/install.sh from the public_mm directory to setup the files for javaapi.

您需要从public_mm目录重新运行./bin/install.sh来设置javaapi的文件。

$ ./bin/install.sh

Windows Graphical Install(windows系统安装图片见官网)

Using Windows Explorer find the "public_mm" directory extracted from the distribution archive. Click on the icon with the name "Install MetaMap". The dialog will display an input box with the label "Location of the Public MetaMap Directory:" filled in with the probable location where you've installed the distribution.

 

 

If the location is incorrent, you can change it by clicking the "Browse" button and using the file dialog to locate the directory or typing in the location in the input text box. When the "public_mm" location is set click the "Next" button to go to the next dialog.

The next dialog will display one of possible locations where the Java Runtime Environment (JRE) is installed. This information is obtained from the Windows Registry which was set when one of the JREs was installed.

 

 

If the JRE location displayed is not the one you wish to use, change it by clicking the "Browse" button and using the file dialog to locate the proper directory or type in the location in the input text box. When the proper JRE location is set click the "Next" button to go to the next dialog.

The next dialog will display a results of install.

 

 

If no errors are present in the log you can close the installation program by pressing the "Finish" button. After that, skip to the section on running MetaMap.

Using the MetaMap server

Starting supporting servers

The MetaMap server (mmserver) must first be running to use the Java API. If the SKR/Medpost Tagger is not already running start it using the following command:

$ ./bin/skrmedpostctl start

Under Windows use the following (In a command prompt window):

\public_mm> bin\skrmedpostctl_start

If you wish to the Word Sense Disambiguation (WSD) Server (optional), start it also.

$ ./bin/wsdserverctl start

Under Windows use the following:

public_mm> bin\wsdserverctl_start

Running the MetaMap server

Then start the MetaMap server:

$ ./bin/mmserver{two-digit-year}

/home/piro/public_mm/bin/SKRrun -L {year} \

     -w /home/piro/public_mm/lexicon /home/piro/public_mm/bin/mmserver{year}.BINARY.Linux -Z {two-digit-year}

Server options: [port(8888),accepted_hosts(['127.0.0.1','130.14.111.76','130.14.110.82'])]

Berkeley DB databases (normal {two-digit-year} strict model) are open.

Static variants will come from table varsan in /home/piro/public_mm/DB/BDB4/DB.normal.{two-digit-year}.strict.

Derivational Variants: Adj/noun ONLY.

Accessing lexicon /home/piro/public_mm/lexicon/data/BDB4/lexiconStatic{four-digit-year}.

Variant generation mode: static.

If you're using Windows XP or Windows 7 then use the command bin\mmserver11 in a "Command Prompt" or "Windows PowerShell" window.

Testing the API

Using another terminal, you can verify that api is running using the program testapi.sh (testapi.bat on Windows) which takes a query as an argument:

$ ./testapi.sh laboratory culture

options: []

terms: laboratory culture

input text:

 laboratory culture

Utterance:

 Id: 00000000.tx.1

 Utterance text:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值