微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Duckling 不提取时间和有序实体

如何解决Duckling 不提取时间和有序实体

我在我的管道中使用 DuckingEntityExtractor 来提取时间和序数实体,但它没有提取一些以前用于 DucklingHTTPExtractor 的实体。但是它适用于小鸭解析器。

这是我的管道和实体示例的片段:

管道:

language: en
pipeline:
  - name: Whitespacetokenizer
  - name: RegexFeaturizer
  - name: LexicalSyntacticFeaturizer
  - name: CountVectorsFeaturizer
  - name: CountVectorsFeaturizer
    analyzer: char_wb
    min_ngram: 1
    max_ngram: 4
  - name: DIETClassifier
    epochs: 100
  - name: EntitySynonymMapper
  - name: "DucklingHTTPExtractor"
    # url of the running duckling server
    url: "http://xxxx.xxx.com"
    # dimensions to extract
    dimensions: ["time","number","email","ordinal"]
    # allows you to configure the locale,by default the language is
    # used
    locale: "de_DE"
  - name: FallbackClassifier
    threshold: 0.7
    ambiguity_threshold: 0.1

示例:

正文:9 月 22 日

Next Message:
22 sep

{
  "text": "22 sep","intent": {
    "id": -1711287076799534405,"name": "book_slot","confidence": 0.9992443919181824
  },"entities": [
    {
      "start": 0,"end": 6,"text": "22 sep","value": "2021-09-22T00:00:00.000-07:00","confidence": 1.0,"additional_info": {
        "values": [
          {
            "value": "2021-09-22T00:00:00.000-07:00","grain": "day","type": "value"
          },{
            "value": "2022-09-22T00:00:00.000-07:00",{
            "value": "2023-09-22T00:00:00.000-07:00","type": "value"
          }
        ],"type": "value"
      },"entity": "time","extractor": "DucklingEntityExtractor"
    }
  ]

正文:下周五

next friday
{
  "text": "next friday","intent": {
    "id": 1386275381868498380,"name": "goodbye","confidence": 0.9995949268341064
  },"entities": []
}

文字:第一

Next message:
First
{
  "text": "First","intent": {
    "name": "nlu_fallback","confidence": 0.5972589552402496
  },"entities": []
}

小鸭解析器输出


cmd: curl -d "text=next friday" -X POST http://xxxx.xxx.com/parse

[{"body":"next friday","start":0,"value":{"values":[{"value":"2021-01-15T00:00:00.000-08:00","grain":"day","type":"value"}],"value":"2021-01-15T00:00:00.000-08:00","type":"value"},"end":11,"dim":"time","latent":false}]

有人可以帮忙吗?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。