使用海底蟒蛇

merp的Python项目详细描述


Downloads

在python中使用mer脚本。

(来自MER存储库)

MER是命名实体识别工具,它给出任何词典,任何输入文本都返回列表。 文本中认可的术语,包括它们的确切位置(注释)。

给定一个本体(owl文件),mer还能够将实体链接到它们的类。

有关MER的更多信息,请参见:

  • mer:用于最小命名实体识别和链接的shell脚本和注释服务器,f.couto和a.lamurias,化学信息杂志,10:582018 [https://doi.org/10.1186/s13321-018-0312-9]
  • MER:最小命名实体识别标记器和注释服务器,F.Couto、L.Campos和A.Lamurias,生物创造V.5挑战评估,2017年 [https://www.researchgate.net/publication/316545534_mer_a_minimal_named-entity_recognition_tagger_and_annotation_server]

依赖关系

awk

mer是使用gnu awk(gawk)和grep开发和测试的。如果你的机器里还有另一个awk解释器,就不能保证程序能正常工作。

例如,要在ubuntu上安装gnu awk:

sudo apt-get install gawk

安装

pip install merpy

python setup.py install

基本用法

>>>importmerpy>>>merpy.process_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()lexiconspreloaded:['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']lexiconsloadedreadytouse:['lexicon','doid','hp']lexiconswithlinkedconcepts:['doid','hp','go','chebi_lite','lexicon']>>>merpy.create_lexicon(["gene1","gene2","gene3"],"genelist")wrotegenelistlexicon>>>merpy.process_lexicon("genelist")>>>merpy.download_lexicon("https://github.com/lasigeBioTM/MER/raw/biocreative2017/data/ChEBI.txt","chebi")wrotechebilexicon>>>merpy.process_lexicon("chebi")

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
安卓 studio安装的java Unity本机广告   java如何将映射转换为对象   java我试图使用rest控制器从h2数据库中检索记录,但它说没有数据集   反思为什么会抛出java。lang.InstanceException?   在opensuse中找不到Java/javac   java为Android上的谷歌地图添加了5900多个标记。如何有效地做   java如何在if语句中使用循环   java如何在JPA(Hibernate)中映射一对多关系和复合主键?   如何在Java中读取和写入外部进程?   Java线程。睡眠时间最短   java使用EclipseGradle插件如何离线托管和使用依赖项(库jar文件)   java为什么虚拟引用在排队时没有被清除?   java无法理解如何创建用于响铃报警的取消按钮   java解析不应通过注入容器错误发生   java Toast或ProgressDialog不显示   java在自定义对象上使用优先级队列的更好方法   java格式的。wmv文件。(或者任何视频文件都很好)   从页面调用另一个侦听器后,不会调用java JSF<f:ajax>侦听器   java注释ConfigApplicationContext不能多次刷新有什么原因吗?