【问题标题】:Lookup table not working after training the model in rasa在 rasa 中训练模型后查找表不起作用
【发布时间】:2021-01-08 02:47:44
【问题描述】:

我是 rasa 的新手。我正在训练模型以使用查找表识别某些实体。我在一个句子中有多个实体,我正在尝试提取它们。

nlu.yml

version: "2.0"
nlu:
- intent: intent_1
  examples : |
    - how many deaths were there last year in [Ohio](Filter-State)?
    - death count of [Florida](Filter-State) this year
    - death count of [Texas](Filter-State) this year
    - what's the death count for this quarter in [CA](Filter-State)?
- lookup: Filter-State
  examples: |
    - Alabama
    - AL
    - Alaska
    - AK
    - Arizona
    - AZ
    - Arkansas
    - AR
    - California
    - CA
    - Colorado
    - CO
    - Connecticut
    - CT
    - Delaware
    - DE
    - District of Columbia
    - DC
    - Florida
    - FL
    - Georgia
    - GA

config.yml

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: 150
    random_seed: 1
  - name: FallbackClassifier
    threshold: 0.7
  - name: DucklingEntityExtractor
    url: http://duckling.rasa.com:8000
    dimensions:
    - email
    - time
  - name: EntitySynonymMapper
policies:
  - name: AugmentedMemoizationPolicy
    max_history: 4
  - name: TEDPolicy
    max_history: 4
    epochs: 100
  - name: RulePolicy
    core_fallback_threshold: 0.4
    core_fallback_action_name: "action_default_fallback"
    enable_fallback_prediction: True

当我训练模型并尝试使用 api 时,它无法从查找表中的状态中识别案例,因此无法将其分配给 slot filter_state。

谁能告诉我我在这里做错了什么以使查找表正常工作!

【问题讨论】:

    标签: rasa-nlu rasa rasa-core


    【解决方案1】:

    我是 Rasa 的新手,正在寻找另一个问题,但我昨晚刚刚遇到并解决了这个问题。

    要使查找表正常工作,您需要将“RegexEntityExtractor”添加到您的管道中,并可能删除 RegexFeaturizer。您还需要在 RegexEntityExtractor 配置中启用查找表。

    config.yml

    pipeline:
       - name: WhitespaceTokenizer
       - name: LexicalSyntacticFeaturizer
       - name: CountVectorsFeaturizer
    
       - name: RegexEntityExtractor
         case_sensitive: False
         use_lookup_tables: True
         use_regexes: True
    ...
    

    【讨论】:

      【解决方案2】:

      能否请您在Rasa forum 上发帖并附上您的设置的更多详细信息?特别是,您使用的是哪个版本的 Rasa Open Source?以上是您的完整 NLU 数据吗? (我认为您需要至少 2 个意图来训练意图分类器。)我还建议您使用 rasa interactive --debug 测试系统并分享例如一个屏幕截图,这将帮助每个人看到确切的输入消息以及它是如何被 Rasa 处理的。我相信我们会追查问题的根源:-)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-09-22
        • 2021-09-03
        • 2020-12-07
        • 1970-01-01
        • 2018-05-04
        • 2018-05-25
        相关资源
        最近更新 更多