Generating Question Answer Database from Unstructured Text
Project description
QA Genie
English | हिंदी
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. It leverages HuggingChat's capabilities for question and answer generation.
Note
This package is in its alpha release and more functionality will be added soon!
Installation
pip install qa_genie
or
pip3 install qa_genie
Usage
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, 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 :)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for qa_genie-1.0.0a2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d2b33ef5b9f6e172141ce6c7e21127091da0bb5d091a9cfa5a05cf1f0c4dc76 |
|
MD5 | fe749f6acb20afa56bcb10125f01364c |
|
BLAKE2b-256 | cf118eef057f2b8d7b8d524244c5e0349a8c2a09464f60c86ee011c7d96a3c4c |