【问题标题】:COLAB ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command outputCOLAB 错误:命令出错,退出状态为 1:python setup.py egg_info 检查日志以获取完整的命令输出
【发布时间】:2020-02-17 21:59:09
【问题描述】:

谁能帮我解决这个问题?如果单词拼写错误,我正在尝试在 colab 中安装 pyenchant 以执行可能的建议。我想使用pyenchant。 这是我尝试过的;

!pip install pyenchant==1.6.8 

但它输出以下错误;

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我的想法是,如果一个词是错误的,得到一些可能的建议, 我打算做以下事情

import enchant
test = enchant.Dict("en_US")
test.suggest("Posible")

谁能建议我如何实现这一目标?我正在研究colab。请帮助我了解如何在 colab 中安装 pyenchant 或任何其他可能的方式,如果一个词有误,我可以获得可能的建议。

【问题讨论】:

    标签: python python-3.x nlp google-colaboratory enchant


    【解决方案1】:

    你需要先用apt安装

    !apt install enchant
    

    然后用 pip

    !pip install pyenchant
    

    【讨论】:

      【解决方案2】:

      另一种基于NLTK没有附魔的可能性是NLTK的单词语料库

      >>> from nltk.corpus import words
      >>> "would" in words.words()
      True
      >>> "could" in words.words()
      True
      >>> "should" in words.words()
      True
      >>> "I" in words.words()
      True
      >>> "you" in words.words()
      True
      

      或者如果你还想使用附魔 https://stackoverflow.com/a/57444274/11339475 看看这个解决方案,已经解决了。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-03-03
        • 2021-03-31
        • 2021-09-03
        • 2020-04-07
        • 1970-01-01
        • 2021-04-15
        • 2020-04-12
        相关资源
        最近更新 更多