# QA Genie
English | [हिंदी](README_hi.md)
QA Genie is a Python package designed for generating questions and answers from unstructured data.
This package is built using the unofficial API of HuggingChat: [hugchat](https://pypi.org/project/hugchat/). It leverages HuggingChat's capabilities for question and answer generation.
[![PyPi](https://img.shields.io/pypi/v/qa_genie.svg?logo=pypi&logoColor=white)](https://pypi.python.org/pypi/qa_genie)
[![Support_Platform](https://img.shields.io/badge/3.9+-%234ea94b.svg?logo=python&logoColor=white)](https://pypi.python.org/pypi/qa_genie)
[![Status](https://img.shields.io/badge/status-operational-%234ea94b.svg?logo=ok&logoColor=white)](https://pypi.python.org/pypi/qa_genie)
[![Downloads](https://static.pepy.tech/badge/qa_genie?logo=download&logoColor=white)](https://www.pepy.tech/projects/qa_genie)
> **Note**
>
> This package is in its alpha release and more functionality will be added soon! <br>
> **Update 1.0.0a3:** This update enables the user to adjust iteration time. (Solves #1)
> **Update 1.0.0a4:** Enables user to get raw text output from chatbot for manual cleaning. Also fixes bugs in cleaning.
## Installation
```bash
pip install qa_genie
```
or
```bash
pip3 install qa_genie
```
## Usage
```python
email = "your_email@example.com" # huggingface account email
password = "your_password" # huggingface account password
model = "meta" # use "meta" to use meta-llama/Llama-2-70b-chat-hf or "oasst" to use OpenAssistant/oasst-sft-6-llama-30b
# Initialize chatbot
chatbot = get_generator(email, password, model)
# Example usage with a single text
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
result_single = extract_qa(chatbot, text, num_qn=3) # returns pandas.DataFrame with num_qn questions and answers
# Example usage with multiple texts
texts = ["Text 1", "Text 2", "Text 3"]
result_multiple = extract_qas(chatbot, texts, num_qn_each=3) # return pandas.DataFrame with num_qn_each questions and answers generated for each text
```
## Important Note
As mentioned by [Soulter](github.com/Soulter), Server resources are precious, it is not recommended to request this API in a high frequency.
## Contributing
Feel free to contribute to QA Genie by creating issues, submitting pull requests, or suggesting improvements. Your contributions are highly appreciated :)
Raw data
{
"_id": null,
"home_page": "",
"name": "qa-genie",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "python,question generation,question answer,nlp,llm,llm for question answering,huggingface",
"author": "Irsh Vijayvargia",
"author_email": "<irsh.iitkgp@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/42/b5/f50a8810f0be98510f053d0601d61668025ecced9ef6f668f46f188e6eca/qa_genie-1.0.0a4.tar.gz",
"platform": null,
"description": "# QA Genie\n\nEnglish | [\u0939\u093f\u0902\u0926\u0940](README_hi.md) \n\nQA Genie is a Python package designed for generating questions and answers from unstructured data.\n\nThis package is built using the unofficial API of HuggingChat: [hugchat](https://pypi.org/project/hugchat/). It leverages HuggingChat's capabilities for question and answer generation.\n\n\n[![PyPi](https://img.shields.io/pypi/v/qa_genie.svg?logo=pypi&logoColor=white)](https://pypi.python.org/pypi/qa_genie)\n[![Support_Platform](https://img.shields.io/badge/3.9+-%234ea94b.svg?logo=python&logoColor=white)](https://pypi.python.org/pypi/qa_genie)\n[![Status](https://img.shields.io/badge/status-operational-%234ea94b.svg?logo=ok&logoColor=white)](https://pypi.python.org/pypi/qa_genie)\n[![Downloads](https://static.pepy.tech/badge/qa_genie?logo=download&logoColor=white)](https://www.pepy.tech/projects/qa_genie)\n\n> **Note**\n>\n> This package is in its alpha release and more functionality will be added soon! <br>\n> **Update 1.0.0a3:** This update enables the user to adjust iteration time. (Solves #1) \n> **Update 1.0.0a4:** Enables user to get raw text output from chatbot for manual cleaning. Also fixes bugs in cleaning.\n\n\n## Installation\n```bash\npip install qa_genie\n```\nor\n```bash\npip3 install qa_genie\n```\n\n\n## Usage\n```python\nemail = \"your_email@example.com\" # huggingface account email\npassword = \"your_password\" # huggingface account password\nmodel = \"meta\" # use \"meta\" to use meta-llama/Llama-2-70b-chat-hf or \"oasst\" to use OpenAssistant/oasst-sft-6-llama-30b\n\n# Initialize chatbot\nchatbot = get_generator(email, password, model)\n\n# Example usage with a single text\ntext = \"Lorem ipsum dolor sit amet, consectetur adipiscing elit.\"\nresult_single = extract_qa(chatbot, text, num_qn=3) # returns pandas.DataFrame with num_qn questions and answers\n\n# Example usage with multiple texts\ntexts = [\"Text 1\", \"Text 2\", \"Text 3\"]\nresult_multiple = extract_qas(chatbot, texts, num_qn_each=3) # return pandas.DataFrame with num_qn_each questions and answers generated for each text\n```\n\n## Important Note\nAs mentioned by [Soulter](github.com/Soulter), Server resources are precious, it is not recommended to request this API in a high frequency.\n\n## Contributing\nFeel free to contribute to QA Genie by creating issues, submitting pull requests, or suggesting improvements. Your contributions are highly appreciated :)\n",
"bugtrack_url": null,
"license": "The Unlicense",
"summary": "Generating Question Answer Database from Unstructured Text",
"version": "1.0.0a4",
"project_urls": {
"GitHub": "https://github.com/1rsh/qa-genie"
},
"split_keywords": [
"python",
"question generation",
"question answer",
"nlp",
"llm",
"llm for question answering",
"huggingface"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "485c9f120a65d0a93131a3e28c23d81ae793fdfe263873de60a31b9e7f83ed79",
"md5": "f9226c573900f1e1f74ddf4e175efff4",
"sha256": "11f2138fa1bf80605ae11a13b64d0a8d0385e95a7ea8d39e6cd56c8539507fc1"
},
"downloads": -1,
"filename": "qa_genie-1.0.0a4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f9226c573900f1e1f74ddf4e175efff4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 4731,
"upload_time": "2024-01-31T16:26:30",
"upload_time_iso_8601": "2024-01-31T16:26:30.315307Z",
"url": "https://files.pythonhosted.org/packages/48/5c/9f120a65d0a93131a3e28c23d81ae793fdfe263873de60a31b9e7f83ed79/qa_genie-1.0.0a4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "42b5f50a8810f0be98510f053d0601d61668025ecced9ef6f668f46f188e6eca",
"md5": "fa15c0dc9e702bebc4d6da36293082b8",
"sha256": "c65b77369d46363b2aed3135aa02dafa357e25bce0e3201ee7bd37c5b0fa3968"
},
"downloads": -1,
"filename": "qa_genie-1.0.0a4.tar.gz",
"has_sig": false,
"md5_digest": "fa15c0dc9e702bebc4d6da36293082b8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 6305,
"upload_time": "2024-01-31T16:26:33",
"upload_time_iso_8601": "2024-01-31T16:26:33.831989Z",
"url": "https://files.pythonhosted.org/packages/42/b5/f50a8810f0be98510f053d0601d61668025ecced9ef6f668f46f188e6eca/qa_genie-1.0.0a4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-31 16:26:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "1rsh",
"github_project": "qa-genie",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "qa-genie"
}