0
from deeppavlov import build_model, configs

snips_model = build_model(configs.classifiers.intents_snips , download=True)
snips_model(["Hello! What is the weather in Boston tomorrow?"])

大家好 - 我可以使用上面 deeppavlov 的预训练模型对预先创建的意图进行意图分类。但是,我想使用 deeppavlov 用我自己的意图和自己的文本创建自己的意图分类模型。总共将有 5 到 7 个意图。

我该怎么做呢?

即我得到的带有文本和意图的样本数据

text,intent
Where is McDonald's?, resturant
What is the weather today, weather
Where is the closest Burger King?, restaurant
Is it sunny today?, weather
What is the temperature today?, weather
4

3 回答 3

2

抱歉回复晚了。如果仍然相关,您可以考虑使用以下自定义分类教程: https ://github.com/deepmipt/DeepPavlov/blob/master/examples/classification_tutorial.ipynb

有几种不同的嵌入方法和模型。您也可以尝试在教程中实现自己的数据集,并使用模型更实际的模型,如基于 BERT 的分类,请参阅_bert目录中的配置https://github.com/deepmipt/DeepPavlov/tree/master/deeppavlov/configs /分类器

于 2021-02-02T09:14:00.280 回答
1

我们在 DeepPavlov 库的 v0.14 中提供了一个名为 Intent Catcher 的新模型/NLP 组件。有了它,您可以提供自己的意图(目前是 JSON 格式,但我们很快会在 YML 中提供更易读的格式),然后根据您的意图训练分类模型。好消息是您还可以使用它通过 RegEx 自动生成更多示例。

您可以在此处了解有关 Intent Catcher 的更多信息:

http://docs.deeppavlov.ai/en/master/features/models/intent_catcher.html

这是有关如何使用它的教程: https ://colab.research.google.com/drive/1l6Fhj3rEVup0N-n9Jy5z_iA3b1W53V6m?usp=sharing

让我们知道这是否适合您

于 2021-05-07T09:10:06.400 回答
0

训练intents_snips模型需要训练数据集。我建议,在收集数据之前,尝试使用轻量级的常见问题解答模型,其中每个类的训练示例很少就足够了。

from deeppavlov import configs, train_model

faq = train_model(configs.faq.tfidf_logreg_en_faq)

a = faq(["I need help"])

详细信息可以在这里找到

于 2020-08-25T09:20:04.437 回答