You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

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

Downloads last month
-
Safetensors
Model size
0.2B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for trientp/vit5-qr

Base model

VietAI/vit5-base
Finetuned
(102)
this model

Dataset used to train trientp/vit5-qr