gpt4 book ai didi

rasa-nlu - 在 rasa 中训练模型后查找表不起作用

转载 作者:行者123 更新时间:2023-12-05 01:32:19 25 4
gpt4 key购买 nike

我是 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 时,它无法从查找表中的状态识别案例,因此无法将其分配给插槽 filter_state。

任何人都可以告诉我我在使查找表工作时做错了什么!

最佳答案

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

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

配置.yml

pipeline:
- name: WhitespaceTokenizer
- name: LexicalSyntacticFeaturizer
- name: CountVectorsFeaturizer

- name: RegexEntityExtractor
case_sensitive: False
use_lookup_tables: True
use_regexes: True
...

关于rasa-nlu - 在 rasa 中训练模型后查找表不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65622756/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com