如何使用Google Cloud Natural Language API查找复数形式

时间:2016-08-13 02:55:16

标签: google-cloud-platform google-cloud-nl

Google Cloud Natural Language API可用于分析文本并返回一个语法分析树,其中每个单词都标有词性标记。

如果名词是复数,是否有办法解除干扰?

如果Google Cloud NL能够解决这个问题,那么信息可能存在,但不会通过API返回?

1 个答案:

答案 0 :(得分:3)

<强>更新

通过NL API的GA启动,annotateText端点现在为每个标记返回一个number键,指示单词是单数,复数还是双字。对于句子“这里有一些猫”,API返回“猫”的以下标记数据(注意numberPLURAL):

{
      "text": {
        "content": "cats",
        "beginOffset": -1
      },
      "partOfSpeech": {
        "tag": "NOUN",
        "aspect": "ASPECT_UNKNOWN",
        "case": "CASE_UNKNOWN",
        "form": "FORM_UNKNOWN",
        "gender": "GENDER_UNKNOWN",
        "mood": "MOOD_UNKNOWN",
        "number": "PLURAL",
        "person": "PERSON_UNKNOWN",
        "proper": "PROPER_UNKNOWN",
        "reciprocity": "RECIPROCITY_UNKNOWN",
        "tense": "TENSE_UNKNOWN",
        "voice": "VOICE_UNKNOWN"
      },
      "dependencyEdge": {
        "headTokenIndex": 1,
        "label": "DOBJ"
      },
      "lemma": "cat"
}

请参阅完整文档here