Пример #1
0
 def test_generate_strings(self):
     """
     Test that we can generate 2 strings of length 10.
     """
     strings = utils.generate_strings(2, 10)
     self.assertEqual(len(strings), 2)
     self.assertEqual(len(strings[0]), 10)
     self.assertEqual(len(strings[1]), 10)
Пример #2
0
 def test_generate_strings(self):
     """
     Test that we can generate 2 strings of length 10.
     """
     strings = utils.generate_strings(2, 10)
     self.assertEqual(len(strings), 2)
     self.assertEqual(len(strings[0]), 10)
     self.assertEqual(len(strings[1]), 10)
Пример #3
0
        'description':
        'Test the synset distance comparison algorithm and Mongo DB storage',
        'logic_adapters': [{
            'import_path':
            'chatterbot.logic.BestMatch',
            'statement_comparison_function':
            'chatterbot.comparisons.synset_distance',
            'response_selection_method':
            'chatterbot.response_selection.get_first_response'
        }],
        'storage_adapter':
        'chatterbot.storage.MongoDatabaseAdapter'
    }])

except ServerSelectionTimeoutError:
    print('Not running Mongo DB benchmarking')

STATEMENT_LIST = utils.generate_strings(10)

for config in CONFIGURATIONS:
    configuration = BASE_CONFIGURATION.copy()
    configuration.update(config)

    chatbot = ChatBot('Benchmark', **configuration)
    chatbot.train(STATEMENT_LIST)

    durration = utils.get_response_time(chatbot)

    print(configuration['description'])
    print('Durration was {} seconds'.format(durration))