Example #1
0
#!/usr/bin/env python3

# Copyright 2015 Conchylicultor. 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.
# ==============================================================================

"""
Main script. See README.md for more information

Use python 3
"""

from chatbot import chatbot


if __name__ == "__main__":
    chatbot = chatbot.Chatbot()
    chatbot.main()
Example #2
0
#!/usr/bin/env python3

# Copyright 2015 Conchylicultor. 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.
# ==============================================================================
"""
Main script. See README.md for more information

Use python 3
"""

from chatbot import chatbot
from chatbot import chatbotstream

if __name__ == "__main__":
    # chatbot = chatbot.Chatbot()
    chatbot = chatbotstream.ChatbotStream()
    chatbot.main()
Example #3
0
"""
Train retrieval-based chatbot on xiaohuangji subtitle dataset.

Use python 3
"""

import os
import sys
sys.path.append(os.getcwd())
sys.path.append(os.getcwd() + '/chatbot')
sys.path.append(os.getcwd() + '/chatbot/corpus')

args_in = '--device gpu0 ' \
          '--test daemon ' \
          '--modelTag xiaohuangji_2l_lr002_dr09_emb256_len20_vocab8000 ' \
          '--vocabularySize 8000 --maxLength 20 ' \
          '--learningRate 0.002 --dropout 0.9 ' \
          '--rootDir /Users/xushuang/sf/chatbot/DeepQA/ ' \
          '--saveEvery 500 ' \
          '--corpus xiaohuangji '.split() # --datasetTag wechat ' \

from chatbot import chatbot
print(args_in)
chatbot = chatbot.Chatbot()
chatbot.main(args_in)
print(chatbot.daemonPredict("工作"))