提交 dc9116d0 编写于 作者: 0 0YuanZhang0 提交者: pkpk

move dam to paddleNLP/Research and fix bug (#3027)

* move_dam_to_research_and_fix_bug

* move_dam_to_research_and_fix_bug
上级 4e553e2b
......@@ -19,9 +19,6 @@ try:
except ImportError as e:
import pickle #python 3
sys.path.append('../../models/dialogue_model_toolkit/deep_attention_matching/')
sys.path.append('../../models/')
from model_check import check_cuda
from net import Net
......
#encoding=utf8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import paddle
import paddle.fluid as fluid
def check_cuda(use_cuda, err = \
"\nYou can not set use_cuda = True in the model because you are using paddlepaddle-cpu.\n \
Please: 1. Install paddlepaddle-gpu to run your models on GPU or 2. Set use_cuda = False to run models on CPU.\n"
):
try:
if use_cuda == True and fluid.is_compiled_with_cuda() == False:
print(err)
sys.exit(1)
except Exception as e:
pass
if __name__ == "__main__":
check_cuda(True)
check_cuda(False)
check_cuda(True, "This is only for testing.")
""""
"""
Utils
"""
......@@ -20,8 +20,9 @@ def mkdir(path):
"""
Mkdir
"""
if not os.path.isdir(path):
mkdir(os.path.split(path)[0])
if not os.path.isdir(path):
if os.path.split(path)[0]:
mkdir(os.path.split(path)[0])
else:
return
os.mkdir(path)
......
# 对话模型工具箱(dialogue_model_toolkit)
- [auto_dialogue_evaluation](./auto_dialogue_evaluation): 对话自动评估模块主要用于评估开放领域对话系统的回复质量,能够帮助企业或个人快速评估对话系统的回复质量,减少人工评估成本。
- [deep_attention_matching](./deep_attention_matching): 深度注意力机制模型是开放领域多轮对话匹配模型。根据多轮对话历史和候选回复内容,排序出最合适的回复。
- [dialogue_general_understanding](./dialogue_general_understanding): 通用对话理解模型,支持意图识别、槽位识别、匹配、对话状态追踪、对话行为识别等对话模型训练;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册