nlp - 将单词转换为特定词性 (POS) 格式?

标签 nlp nltk

给定一个单词,是否可以使用 NLTK 将该单词转换为特定的词性 (POS) 形式?例如,给定单词“run”,我可以要求 NLTK 将其转换为以下任意内容:

VBZ: runs, as in "George runs to the store."
VBD: ran,  as in "George ran to the store."
VB:  run,  as in "George wants to run."

等等。如果是,名词也一样吗?例如:

NN:  run,  as in "George wants to run."
NNS: runs, as in "George went for two runs."
NNP: Run,  as in "George had dinner at Run."

最佳答案

你应该尝试pattern

它具有以下功能:

  • 复数+单数
  • 比较级+最高级
  • 动词变位
  • 量化

希望这有帮助。

关于nlp - 将单词转换为特定词性 (POS) 格式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18553632/

相关文章:

python - 如何在 doc2vec 模型中使用预训练的 word2vec 向量?

python - 嵌套列表/字典理解如何添加缺少的元素

python - 如何分析sklearn中tfidf矩阵的值?

javascript - 二郎题

python - 使用 Python NLTK 对大型 (>70MB) TXT 文件进行标记。串联并写入数据以流式传输错误

ruby - 如何将单词转换为它们的等效数字?

Pereira 中的 Prolog 运算符错误

python - 如何使用 scikit learn 计算多类案例的准确率、召回率、准确率和 f1 分数?

python - 如何获得发送者开始和结束的索引?

python - 如何解决NLTK LookupError(resource_not_found)?它存在于路径中。 (Python)