Package that makes chatbots automatically
Project description
AutoChatBot
Authors-
- Kritik Seth
For documentation- either scroll down or click here
clean
def make_train_dataset(lines, conv_lines):
takes input of lines and conversations, returns a list of questions and answers
:type lines: string
:param lines: path were text file of lines is present
:type conv_lines: string
:param conv_lines: path were text file of conversations is present
def clean_train_dataset(text):
takes input list of questiond or answers, returns clean list of strings
:type text: text
:param text: list of strings
def make_count_dict(q, a):
makes a dictionary of words
:type q: list
:param q: list of questions
:type a: list
:param a: list of answers
def count_rare_words(cd, mincount):
counts the number of rare words
:type cd: dictionary
:param cd: count dictionary {word:key}
:type mincount: int
:param mincount: minimum length of a question
def make_word_dict(cd, mincount, tokens={'':0, '':1, '':2, '':3}):
makes dictionary, returns mapping of word to key and key to word
:type cd: dictionary
:param cd: count dictionary {word:key}
:type mincount: int
:param mincount: min frequency of word such that it makes it into the word_dict
:type tokens: dictionary
:param tokens: default - {'<PAD>':0, '<SOS>':1, '<EOS>':2, '<UNK>':3}
def add_word_tags(q, a, wd):
takes input of {word:key} and adds tags to those words
:type q: list
:param q: list of questions
:type a: list
:param a: list of answers
:type wd: dict
:param wd: mapping of word to key
def make_line_id(q, a, wd):
takes input list of questions or answers and word_dict and returns text converted to id
:type q: list
:param q: list of questions
:type a: list
:param a: list of answers
:type wd: dict
:param wd: mapping of word to key
def sort_line_pad(q, a, max_line_length):
sorts questions and answers based on their length, returns sorted list of question or answer
:type q: list
:param q: list of questions
:type a: list
:param a: list of answers
:type max_line_length: int
:param max_line_length: maximum length of question or answer
chat
def make_test_chatbot(dir_path, files_list, ntest):
takes input of direcotory of file, list, and number of test cases
:type lines: string
:param lines: path were text file of lines is present
:type conv_lines: string
:param conv_lines: path were text file of lines is present
:type conv_lines: string
:param conv_lines: base path were text file of lines is present
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
AutoChatbot-0.1.1.tar.gz
(5.8 kB
view details)
Built Distribution
File details
Details for the file AutoChatbot-0.1.1.tar.gz
.
File metadata
- Download URL: AutoChatbot-0.1.1.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2550dea7fd765ff77a7d23103aa553054e5133f9bf727a1def4d16eb1d86cfb4 |
|
MD5 | 20dbf6cc7504f4e5efd112d410b80274 |
|
BLAKE2b-256 | 9e831290269c3bf36ee20bd8db66d938e338e6088fdfdc144c7056b10205622a |
File details
Details for the file AutoChatbot-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: AutoChatbot-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ffc8f7e5c9ad498a01b9d4d033a87b15d7b70e4fbca61ad41f01808fef73d75 |
|
MD5 | cab9f2843d6eb9e8b9a0a5a607db040a |
|
BLAKE2b-256 | 91829e0a8f51e922a5189ce8a2b1bf9b57e1ab171dc88b512da391d8992daf3a |