1. 安装指令

    pip install allennlp
    pip install allennlp-models
    
  2. coreference resolution的应用

    from allennlp.predictors.predictor import Predictor
    # path can be url or local path (pre-downloaded file)
    predictor = Predictor.from_path("https://storage.googleapis.com/allennlp-public-models/coref-spanbert-large-2021.03.10.tar.gz")
    text = "Eva and Martha didn't want their friend Jenny to feel lonely so they invited her to the party."
    prediction = predictor.predict(document=text)  # get prediction
    print(prediction['clusters'])  # list of clusters (the indices of spaCy tokens)
    # Result: [[[0, 2], [6, 6], [13, 13]], [[6, 8], [15, 15]]]
    print(predictor.coref_resolved(text))  # resolved text
    # Result: "Eva and Martha didn't want Eva and Martha's friend Jenny to feel lonely so Eva and Martha invited their friend Jenny to the party."
    

    其他相关问题:
    (1)allennlp + wordnet + zipfile.BadZipFile error
    (2)离线安装nltk_data

  3. spacy安装和使用问题(tokenizer)

    pip install spacy
    
    import spacy
    nlp = spacy.load('en_core_web_sm')  # load the model
    text = "Eva and Martha didn't want their friend Jenny to feel lonely so they invited her to the party."
    doc = nlp(text)  # get the spaCy Doc (composed of Tokens)
    print(list(doc)) # tokens
    

    加载en_core_web_sm模型可能会出现SSL error的问题,可以到官方release下载和当前spacy版本对应的模型,然后利用pip进行安装:

    pip show spacy # show the version of spacy
    pip install en_core_web_sm-x.x.x.tar.gz # install the model without proxy - method 1
    python -m spacy download en_core_web_sm # install the model with proxy - method 2
    

    其他相关问题:
    (1)解决neuralcoref和spacy版本兼容性问题

Allennlp 安装和使用问题相关推荐

  1. 【疑难杂症】allennlp安装报错:Installing build dependencies ... error

    背景: 配置PURE的算法环境,安装allennlp 0.9.0 (pip install allennlp==0.9.0)报错,如图所示: 探索: 发现allennlp的依赖中有spacy,是在安装 ...

  2. mac下pip install 安装只能选择python2.7的问题

    mac自带python2.7. 我用brew install安装过python3:brew install python3 我安装了anaconda3.因为它自带了很多包.所以我无论是用pycharm ...

  3. 记录elmoformanylangs安装

    elmoformanylangs网址:https://github.com/HIT-SCIR/ELMoForManyLangs 需要预先准备的环境: python >= 3.6 torch al ...

  4. 安装allennlp

    安装allennlp github链接 1'Download and install Conda. 下载 运行bash 2.Create a Conda environment with Python ...

  5. 安装allennlp ,使用Elmo

    问题1:从github项目clone后,安装 "pip install . ",报错:Module Not Found Error: No module named 'allenn ...

  6. 开关变压器绕制教程_教程:如何将变压器权重和令牌化器从AllenNLP上传到HuggingFace

    开关变压器绕制教程 This is the first of a series of mini-tutorials to help you with various aspects of the Al ...

  7. HIT-SCIR/Elmoformanylanguages安装记录

    HIT-SCIR/Elmoformanylanguages 记录踩坑 首先从官网下载源码 哈工大Elmoformanylangs 这里提供了简体中文版本链接:zhs.model 提取码:p53m 然后 ...

  8. linux环境下nacos的安装+启动,阿里云服务器安装nacos

    nacos安装+启动(linux环境): 基础:安装java环境 官网下载压缩包:如 nacos-server-1.2.1.tar.gz 放在自定义目录下 # 解压 tar -xvf nacos-se ...

  9. Alibaba Cloud Linux 2.1903 LTS 64位服务器yum源下载404,Alibaba Cloud Linux 2实例中使用docker-ce、epel等YUM源安装软件失败

    [Alibaba Cloud Linux 2.1903 LTS 64位]服务器yum源下载404 failure: repodata/repomd.xml from docker-ce-stable: ...

  10. Linux下docker安装配置oracle,oracle创建用户并远程连接,实测可用!

    最近在给同学弄毕业设计的数据库,因为oracle在个人电脑上极不稳定,所以他的电脑数据库崩溃了,这时候我就在docker上为他拉了一个oracle,解决了问题. docker的安装共有以下几步,实测没 ...

最新文章

  1. 进程间通信:同步双工管道
  2. Maven项目下update maven后Eclipse报错:java.lang.ClassNotFoundException: org.springfra
  3. 【TCP/IP详解 卷一:协议】第十二章 广播和多播
  4. python绘制帕累托图
  5. python web开发c6——阿里云上ubuntu+flask+gunicorn+nginx服务器部署(一)简单测试
  6. [异常解决] How to build a gcc toolchain for nRF51 on linux (very detailed!!!)
  7. laravel 模型事件 updated 触发条件
  8. 5类6类7类网线对比_五类网线、六类网线和七类网线有什么区别?如何挑选网线?...
  9. centos7安装python开发环境(python3_postgresql_sublime_supervisor)
  10. 怎么记住计算机快捷键,快速记忆电脑快捷键的方法
  11. NLTK-004:加工原料文本
  12. 2019级软件工程应用与实践-人工智能快递柜(代码分析9)
  13. 每页都有的表头和打印分页
  14. 打印机手动打印双面的防止顺序
  15. 如何使用 CSS flex box 和 Javascript 设计棋盘
  16. luogu2947向右看齐【栈】
  17. 直立麦轮车模-初见样品模样
  18. java 日期转换视频_自定义转换器实现日期转换_JavaEE框架(Maven+SpringMvc+Spring+MyBatis)全程实战教程_Java视频-51CTO学院...
  19. 西门子触摸屏函数翻译_西门子触摸屏软件Wincc flexible 使用总结
  20. 计算机网络引言【读书笔记】

热门文章

  1. 《机器学习实战》--资料下载和运行环境
  2. Power BI中使用的M语言
  3. html json加密 ajax请求问题
  4. 用python实现词频统计
  5. DSP 程序远程升级 / Bootloader设计指南(六)—— 9大关键点
  6. 关于用VGG19网络来做8分类任务的总结
  7. navicat工具能安装在linux,linux下安装navicat
  8. java网页内容不能复制_win7系统禁用Java小程序脚本网页内容复制不了的解决方法...
  9. cximage函数总结
  10. windows抓wifi包 Microsoft Network Monitor