contrib_bots: Restructure bots to follow a consistent structure.
Now all the bots that are stored in contrib_bots are in the same file/directory format. The format is specified here #3427. Add tests.py file for encrypt_bot as well. Fixes #3427.
This commit is contained in:
parent
2282000d78
commit
0419848d3c
42 changed files with 79 additions and 45 deletions
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
|
@ -15,10 +15,10 @@ CONTRIB_BOTS_DIR = os.path.dirname(os.path.abspath(__file__))
|
|||
os.chdir(os.path.dirname(CONTRIB_BOTS_DIR))
|
||||
sys.path.insert(0, os.path.dirname(CONTRIB_BOTS_DIR))
|
||||
|
||||
JOKES_PATH = os.path.join(CONTRIB_BOTS_DIR, 'John/var/jokes.json')
|
||||
DATABASE_PATH = os.path.join(CONTRIB_BOTS_DIR, 'John/var/database.db')
|
||||
DIRECTORY_PATH = os.path.join(CONTRIB_BOTS_DIR, 'John')
|
||||
VAR_PATH = os.path.join(CONTRIB_BOTS_DIR, 'John/var')
|
||||
JOKES_PATH = os.path.join(CONTRIB_BOTS_DIR, 'assets/var/jokes.json')
|
||||
DATABASE_PATH = os.path.join(CONTRIB_BOTS_DIR, 'assets/var/database.db')
|
||||
DIRECTORY_PATH = os.path.join(CONTRIB_BOTS_DIR, 'assets')
|
||||
VAR_PATH = os.path.join(CONTRIB_BOTS_DIR, 'assets/var')
|
||||
|
||||
if not os.path.exists(DIRECTORY_PATH):
|
||||
os.makedirs(DIRECTORY_PATH)
|
||||
|
|
|
@ -10,7 +10,7 @@ interactive bot that uses machine learning heuristics to simulate a
|
|||
conversation with the user. He has a great sense of humor and
|
||||
is also powered by Open Source code!
|
||||
|
||||

|
||||

|
||||
|
||||
How it works?
|
||||
John is initially trained with Corpus files, or large text files.
|
||||
|
@ -20,11 +20,11 @@ try to find the response that best matches the input according to the Levenshtei
|
|||
which is a string metric for measuring the difference between two sequences. If several
|
||||
responses have the same acurracy, he will choose one at random.
|
||||
|
||||

|
||||

|
||||
|
||||
Can he learn by himself?
|
||||
John's engine allows him to learn from his conversations with people. However,
|
||||
without strict supervision bots that learn from people can do harm, so learning
|
||||
is currently restricted to his initial corpus.
|
||||
|
||||

|
||||

|
Loading…
Add table
Add a link
Reference in a new issue