Model Card: trientp/vit5-qr
A query rewriting model based on ViT5-base, fine-tuned for multi-turn question rewriting in Conversational Search settings. The model takes a dialogue context with prior questions and answers (separated by <pad>) and generates a standalone version of the latest question, making it self-contained and understandable without previous turns.
Intended Use
Use Case
Used in multi-turn QA systems or virtual assistants that need to reformulate user questions based on prior conversational context.
Input Format
[question_1] <pad> [answer_1] <pad> [question_2] <pad> [answer_2] ... <pad> [question_t]
Output
A fully rewritten question based on the conversation history that can be used in a retriever or reader model.
Example
Input
Ai là hoàng đế đầu tiên của Đế chế La Mã và ông đã cai trị bao lâu? <pad> Augustus là hoàng đế đầu tiên ... <pad> Tên và biệt danh của ông trước khi trở thành hoàng đế là gì?
Output
Tên khai sinh và biệt danh của Hoàng đế Augustus trước khi lên nắm quyền?
How to Use
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("trientp/vit5-qr")
model = AutoModelForSeq2SeqLM.from_pretrained("trientp/vit5-qr")
input_text = "Ai là hoàng đế đầu tiên của Đế chế La Mã và ông đã cai trị bao lâu? <pad> Augustus là hoàng đế đầu tiên ... <pad> Tên và biệt danh của ông trước khi trở thành hoàng đế là gì?"
inputs = tokenizer(input_text, return_tensors="pt", max_length=512, truncation=True)
output = model.generate(**inputs, max_length=64)
rewritten_query = tokenizer.decode(output[0], skip_special_tokens=True)
print(rewritten_query)
Author & Contact
- Author: Phat-Trien Thai
- Email: tptrien.sdh231@hcmut.edu.vn
- Downloads last month
- -
Model tree for trientp/vit5-qr
Base model
VietAI/vit5-baseDataset used to train trientp/vit5-qr
Viewer • Updated • 123k • 4