{"id":23264153,"url":"https://github.com/jdgregson/datahaus","last_synced_at":"2025-10-12T00:06:22.956Z","repository":{"id":67868937,"uuid":"85467088","full_name":"jdgregson/datahaus","owner":"jdgregson","description":"Simple chat bot in Python. Uses a MySQL database to store responses to a given sentence subject. Requires NLTK to be installed on the system.","archived":false,"fork":false,"pushed_at":"2017-03-19T11:40:25.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-12T12:18:58.799Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdgregson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-19T10:18:38.000Z","updated_at":"2017-12-22T05:20:39.000Z","dependencies_parsed_at":"2023-07-21T11:31:30.191Z","dependency_job_id":null,"html_url":"https://github.com/jdgregson/datahaus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdgregson%2Fdatahaus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdgregson%2Fdatahaus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdgregson%2Fdatahaus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdgregson%2Fdatahaus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdgregson","download_url":"https://codeload.github.com/jdgregson/datahaus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445648,"owners_count":20939953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-19T14:30:25.835Z","updated_at":"2025-10-12T00:06:17.921Z","avatar_url":"https://github.com/jdgregson.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# datahaus\nA simple chat bot written in Python. Datahaus uses a MySQL database to store \nresponses to a given sentence subject. It requires NLTK to be installed on the\nsystem. NLTK ([Natural Language Tool Kit](http://www.nltk.org/)) is used to \ndetermine the subject of the user's input so that a logical response can be \nselected from the database.\n\nAs a very simple example, lets say your database has a key of \"cats\" with a\nvalue of \"I really like cats. I often collect them.\" The conversation would look\nsomething like this:\n```\nQuery\u003e what do you think of cats?\nI really like cats. I often collect them.\n```\n\n## How to create the MySQL table\nThe default table datahaus uses is a simple key-value setup, which can be\ndescribed as follows:\n```SQL\n+-------+---------------+------+-----+---------+-------+\n| Field | Type          | Null | Key | Default | Extra |\n+-------+---------------+------+-----+---------+-------+\n| k     | varchar(256)  | YES  |     | NULL    |       |\n| v     | varchar(1024) | YES  |     | NULL    |       |\n+-------+---------------+------+-----+---------+-------+\n```\n\nIt can be created using the following create script:\n```SQL\nCREATE TABLE `key_value_pairs` (\n  `k` varchar(256) DEFAULT NULL,\n  `v` varchar(1024) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n```\n\n## How to teach datahaus\nDatahaus is only as smart as the database it uses to get its responses. By\ndefault your database will be empty and you'll need to teach it. There are\nseveral different ways to teach it, so just follow along with the example\nbelow and you can figure it out:\n```\nQuery\u003e learn cats: I really like cats. I often collect them.\n\nQuery\u003e set dogs = I like dogs. They get your sense of humor. Nobody else does that.\n\nQuery\u003e what do you think of dogs?\n I like dogs. They get your sense of humor. Nobody else does that.\n\nQuery\u003e I hate cats.\n I really like cats. I often collect them.\n```\n\"Set\" and \"learn\" do the same thing.\n\n## How to see what datahaus knows about a subject\nTo display a list of possible responses to a given input, you can use the \"get\"\nkeyword, which will cause datahaus to display a list of possible responses, as\nfollows:\n```\nQuery\u003e get cats\n----\ncats:  I really like cats. I often collect them.\n```\nThe \"list\" keyword is another way to use the \"get\" keyword.\n\n## How to make datahaus forget\nTo delete a response from the database, you can use the \"forget\" keyword, as\nfollows:\n```\nQuery\u003e forget cats\n----\ncats:  I really like cats. I often collect them.\n\nDelete above rows? (Y/N): y\nQuery\u003e get cats\n\nQuery\u003e what do you think of cats?\nI don't have anything to say about that.\n\n```\nThe \"del\" and \"drop\" keywords are other ways to use the \"forget\" keyword.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdgregson%2Fdatahaus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdgregson%2Fdatahaus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdgregson%2Fdatahaus/lists"}