{"id":31040547,"url":"https://github.com/msamsami/qna-builder","last_synced_at":"2025-09-14T08:55:36.177Z","repository":{"id":46537690,"uuid":"414647396","full_name":"msamsami/qna-builder","owner":"msamsami","description":"Similarity-based question-and-answering (QnA) chat bot","archived":false,"fork":false,"pushed_at":"2023-07-13T02:02:18.000Z","size":298,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-14T22:51:08.809Z","etag":null,"topics":["chatbot","conversational-bot","qna-model"],"latest_commit_sha":null,"homepage":"","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/msamsami.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}},"created_at":"2021-10-07T15:03:37.000Z","updated_at":"2025-01-08T19:05:01.000Z","dependencies_parsed_at":"2022-09-07T03:51:18.634Z","dependency_job_id":null,"html_url":"https://github.com/msamsami/qna-builder","commit_stats":null,"previous_names":["msamsami/qna-builder"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/msamsami/qna-builder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msamsami%2Fqna-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msamsami%2Fqna-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msamsami%2Fqna-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msamsami%2Fqna-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msamsami","download_url":"https://codeload.github.com/msamsami/qna-builder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msamsami%2Fqna-builder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275082361,"owners_count":25402339,"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","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["chatbot","conversational-bot","qna-model"],"created_at":"2025-09-14T08:55:29.427Z","updated_at":"2025-09-14T08:55:36.169Z","avatar_url":"https://github.com/msamsami.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QnA Builder\n\n![](https://img.shields.io/badge/version-v0.1.3-green)\n![](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9-blue)\n![](https://github.com/msamsami/qna-bot/actions/workflows/python-publish.yml/badge.svg)\n[![](https://img.shields.io/pypi/v/qna-builder)](https://pypi.org/project/qna-builder/)\n![](https://img.shields.io/pypi/dm/qna-builder)\n\n\u003cp\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/msamsami/qna-builder/main/docs/logo.jpg\" alt=\"QnA Builder logo\" width=\"200\"/\u003e\n\u003cbr\u003e\n\u003c/p\u003e\n\n## Introduction\n**QnA Builder** is a simple, no-code way to build chatbots in Python. It provides a similarity-based conversational dialog\nengine, **QnA Bot**, which makes it easy to generate automated responses to input questions according to a set of known\nconversations, i.e., question-answer pairs, stored in a ***knowledge base***. QnA Bot relies on a collection of\nquestion-answer pairs to generate answers for new inputs.\n\n## Install\nThe easiest way to install the qna-builder is by using `pip`:\n```shell\npip install qna-builder\n```\nThis library is shipped as an all-in-one module implementation with minimalistic dependencies and requirements.\n\n## Getting started\nA QnA Bot can be set up and used in four simple steps:\n\n1. Import `QnABot` class\n\n```python\nfrom qnabuilder import QnABot\n```\n\n2. Initialize a bot\n```python\nbot = QnABot()\n```\n\n3. Fit the bot engine to a knowledge base\n```python\nbot.fit(kb=\"knowledge_base.json\")\n```\n\n4. Generate answers\n```python\nbot.answer(\"Hey. What's up?\")\n```\n`\"All good. What's up with you?\"`\n\n## Algorithms\nCurrently, QnA Bot engine supports the following algorithms for similarity-based answer generation:\n- TF-IDF Vectorization (`'tfidf'`)\n- Murmurhash3 Vectorization (`'murmurhash'`)\n- Count Vectorization (`'count'`)\n\nSupported similarity metrics are as follows:\n- Cosine similarity (`'cosine'`)\n- Euclidean distance (`'euclidean'`)\n- Manhattan distance (`'manhattan'`)\n\n## Knowledge base editor\nBy calling `run_editor()` method of `QnAKnowledgeBase` class, the knowledge base editor window will open up in\nyour web browser and allows you to edit your knowledge base by adding, removing, or modifying questions/answers.\n\n```python\nfrom qnabuilder import QnAKnowledgeBase\n\nkb = QnAKnowledgeBase('my_knowledge_base.json')\nkb.run_editor()\n```\n\nHere, you can see a screenshot of the knowledge base editor:\n\n\u003cdiv style=\"text-align:center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/msamsami/qna-builder/main/docs/kb_editor.png\" alt=\"QnA Bot Knowledge Base Editor\" width=\"450\"/\u003e\n\u003c/div\u003e\n\nNote that you need to install the optional requirement [streamlit](https://streamlit.io/) to be able to use the\nknowledge base editor.\n\n## Tests\nTo run the tests, install development requirements:\n```\npip install -r requirements_dev.txt\n```\n\nThen, run pytest:\n```\npytest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsamsami%2Fqna-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsamsami%2Fqna-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsamsami%2Fqna-builder/lists"}