Downloads · 30 days
6
14% of all-time downloads
miiiciiii/I-Comprehend_qg
I-Comprehend_qg is a text generation model from miiiciiii. Use it when you need the model to write or continue text.
The I-Comprehend Question Generation Model is a T5-based model designed to generate questions from a given context and answer. This model is particularly useful for educational purposes, automated content creation, an…
Downloads · 30 days
6
14% of all-time downloads
All-time downloads
43
Public
Parameters
223M
1.8 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors892 MB · 100%
From the Hugging Face model README
The I-Comprehend Question Generation Model is a T5-based model designed to generate questions from a given context and answer. This model is particularly useful for educational purposes, automated content creation, and enhancing reading comprehension tools.
To use this model, you need to have the transformers library installed. You can install it via pip:
pip install transformers
To use the model, load it with the appropriate tokenizer and model classes from the transformers library. Ensure you have the correct repository ID or local path.
from transformers import T5ForConditionalGeneration, T5Tokenizer
# Load the model and tokenizer
model = T5ForConditionalGeneration.from_pretrained("miiiciiii/I-Comprehend_qg")
tokenizer = T5Tokenizer.from_pretrained("miiiciiii/I-Comprehend_qg")
def get_question(context, answer, model, tokenizer):
"""Generate a question for the given answer and context."""
answer_span = context.replace(answer, f"<hl>{answer}<hl>", 1) + "</s>"
inputs = tokenizer(answer_span, return_tensors="pt")
question = model.generate(input_ids=inputs.input_ids, max_length=50)[0]
return tokenizer.decode(question, skip_special_tokens=True)
# Define the context and answer
context = "The Eiffel Tower is located in Paris and is one of the most famous landmarks in the world."
answer = "Eiffel Tower"
# Generate the question
question = get_question(context, answer, model, tokenizer)
print("Generated Question:", question)
We welcome contributions to improve the model or expand its capabilities. Please feel free to open issues or submit pull requests.
[MIT License]
For any questions or issues, please contact [[email protected]].