用于在 Ruby 中查找句子中的名词和含义中最接近的形容词的 API
我正在寻找可以做两件事的 API 或 Ruby Gem。首先是查找每个单词,看看它是否是名词。我想做的第二件事是查找形容词(也许还有名词)并找到与之最相似的单词。最好的方法是什么?
I'm looking for an API or Ruby Gem that can do two things. The first is look up each word and see if it is a noun or not. The second thing I want to be able to do is look up adjectives (and maybe nouns) and find the word that is most identical to it. What is the best way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不了解 Ruby,但要确定单词的词性(例如它是否是名词),您需要所谓的“词性标记器”。对于第二部分,听起来 WordNet 会帮助你。 WordNet 是一个英语单词数据库(你没有说出你感兴趣的语言),其关系包括“意义相似”、“更具体”(比如“猫”比“动物”更具体)、“相反”的意义”等。
I don't know about Ruby, but to determine the part of speech of a word (like whether it's a noun) you need what's called a "part of speech tagger". For the second part, it sounds like WordNet will help you. WordNet is a database of English words (you didn't say what language you're interested in) with relationships like "similar in meaning", "more specific" (like "cat" is more specific than "animal"), "opposite in meaning", etc.