ims词义消歧工具的python包装(zhong和ng,2010)

pyims的Python项目详细描述


pyims

一个简单的python包装器,围绕ims(它是有意义的)词义消歧工具包,它集成了nltk的wordnet接口。需要单独下载ims,这需要一个工作的java安装。还需要下载wordnet的nltk。只有在Linux中测试过,可能在其他操作系统中不起作用。为Python3.6+构建

安装

首先,按照Section 3 of the IMS Readme中的说明将ims的组件安装到某个目录中;从here(步骤3.e)中将模型提取到与步骤3.b和3.c相同的目录中。然后,运行:

pip install pyims

用法

frompyimsimportPyIMSwsd=PyIMS("path/to/ims","modelsDirName")print(wsd.disambiguate("I am interested in the interest rates at the bank.",probs=True,synsets=False))# If probs=True, returns a list of (token, probability_distribution) tuples where probability_distribution is a map of lemma to its probability# If probs=False (default False), returns a list of (token, lemma) where lemma is the most probable word-sense in WordNet for the given token# If synsets=True, lemmas are replaced with the Synsets to which they belong# If synsets=False (default False), to access a lemma's synset, call lemma.synset()

参考文献

  • 钟,智和吴,和头。2010年。这是有意义的:一个广泛覆盖的词义消歧系统的自由文本。《2010年美国公民自由联盟系统演示会议录》,第78-83页,瑞典乌普萨拉

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

推荐PyPI第三方库


热门话题
java类。getResource和ClassLoader。getSystemResource:有没有理由选择其中一个而不是另一个?   在Java中以编程方式粘贴后恢复剪贴板   Java字符串到日期没有时间   JavaSpring注释:@Component起作用,@Repository不起作用   java“addScript”在HSQL中是否有最大记录计数?   java如何将值从JDialog框返回到父JFrame?   java我的模块库的用户有没有办法访问尚未导出的类?   java javac:未找到命令   java如何解决jsoup错误:无法找到请求目标的有效证书路径   类中的java作用域变量   Java中集合实现中的arraylist add()方法不起作用   java如何使用while循环和从用户接收输入来近似Pi?   java Spring安全CSRF培训模式   在安卓系统中,如何通过在警报框外单击来限制用户?