0 / 0
Go back to the English version of the documentation
名词短语抽取
Last updated: 2024年7月29日
名词短语抽取

Watson Natural Language Processing 名词短语抽取块从输入文本中抽取名词短语。

块名

noun-phrases_rbr_<language>_stock

注: 模型名称中的 "rbr" 缩写表示基于规则的推理。 RBR 模型处理语法上的常规实体类型,例如数字,电子邮件和电话。

受支持的语言

名词短语抽取可用于以下语言。 有关语言代码和相应语言的列表,请参阅 语言代码

ar , cs , da , de , es , en , fi , fr , he , hi , it , ja , ko , nb , nl , nn , pt , ro , ru , sk , sv , tr , zh_cn , zh_tw

功能

名词短语抽取块从输入文本中抽取非重叠名词短语。

基于示例的名词短语抽取功能
功能 示例
非重叠名词短语的抽取 "Anna went to school at University of California Santa Cruz" -> Anna, school, University of California Santa Cruz

对其他块的依赖关系

代码样本

import watson_nlp

# Load the model for English
noun_phrases_model = watson_nlp.load('noun-phrases_rbr_en_stock')

# Run the model on the input text
noun_phrases = noun_phrases_model.run('Anna went to school at University of California Santa Cruz')
print(noun_phrases)

代码示例的输出:

{
  "noun_phrases": [
    {
      "span": {
        "begin": 0,
        "end": 4,
        "text": "Anna"
      }
    },
    {
      "span": {
        "begin": 13,
        "end": 19,
        "text": "school"
      }
    },
    {
      "span": {
        "begin": 23,
        "end": 58,
        "text": "University of California Santa Cruz"
      }
    }
  ],
  "producer_id": {
    "name": "RBR Noun phrases",
    "version": "0.0.1"
  }
}

父主题: Watson Natural Language Processing 任务目录

Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more