Skip to main content

VietQuill: A Unified Framework for Controllable Vietnamese Paraphrase Generation and Quality Estimation

Project description

VietQuill: A toolkit for Vietnamese Paraphrase Generation and Evaluation

PyPI Python License

Vietnamese Task Models

VietQuill: A Unified Framework for Controllable Vietnamese Paraphrase Generation and Quality Estimation

English | Tiếng Việt

VietQuill is a unified framework for controllable Vietnamese paraphrase generation and quality estimation, supporting both research and production applications.

It centralizes datasets, generation methods, augmentation techniques, and evaluation metrics into a consistent interface, enabling researchers and practitioners to develop, benchmark, and deploy paraphrase systems with minimal effort. VietQuill aims to serve as a common foundation for the Vietnamese paraphrase generation ecosystem, promoting reproducible research, standardized evaluation, and the development of high-quality paraphrase technologies for education, information retrieval, question answering, conversational AI, and other natural language processing applications.

We are committed to advancing Vietnamese paraphrase generation by making state-of-the-art methods accessible, customizable, and easy to integrate into real-world workflows.


Installation

Create and activate a virtual environment with venv and project manager.

python -m venv .\venv

Install VietQuill in your virtual environment.

pip install vietquill

Quickstart

Paraphrase Generate

Using AutoModelForControllableParaphraseGeneration for fine-grained control over lexical, semantic, and syntactic attributes.

from vietquill import AutoModelForControllableParaphraseGeneration

paraphraser = AutoModelForControllableParaphraseGeneration()

sentences = [
    "Hôm nay trời đẹp quá, mình muốn đi dạo công viên.",
    "Thủ đô của nước Pháp là thành phố nào?",
]

for sentence in sentences:
    paraphrase = paraphraser.generate(sentence, num_candidates=2)
    print(f"Original: {sentence}")
    print(f"Paraphrase: {paraphrase}")

# >>> Original: Hôm nay trời đẹp quá, mình muốn đi dạo công viên.
# >>> Paraphrase: ['Hôm nay trời đẹp, tôi muốn đi dạo công viên.', 'Hôm nay trời đẹp quá, tôi muốn đi dạo công viên.']
# >>> Original: Thủ đô của nước Pháp là thành phố nào?
# >>> Paraphrase: ['Nước Pháp có thủ đô là thành phố nào?', 'Nước Pháp có thủ đô là thành phố tên gì?']

Using lexical, syntactic, semantic for tunning paraphrase quality and diversity.

from vietquill import AutoModelForControllableParaphraseGeneration

paraphraser = AutoModelForControllableParaphraseGeneration()
sentence = "Tôi rất thích ăn phở vào buổi sáng và uống một cốc cà phê nóng."

# Generate with specific control levels
paraphrase = paraphraser.generate(sentence, lexical=90, syntactic=70, semantic=70, num_candidates=2)
print(paraphrase)
# >>> ['Bữa sáng tôi ăn phở, uống một cốc cà phê nóng.', 'Bữa sáng tôi ăn phở và một cốc cà phê nóng.']

Paraphrase Evaluate

Evaluate the quality of generated paraphrases using various metrics and estimators.

from vietquill.evaluation import BLEUMetric, LexicalEstimator
original = "Hôm nay trời đẹp quá."
paraphrase = "Hôm nay trời đẹp ghê."
metric = BLEUMetric()
result = metric.score(original, paraphrase)
print(result)
# >>> 0.668740304976422
from vietquill.evaluation import LexicalEstimator
original = "Hôm nay trời đẹp quá."
paraphrase = "Hôm nay trời đẹp ghê."
lex_est = LexicalEstimator()
result = lex_est.estimate(original, paraphrase)
print(result)
# >>> {'lexical_score': 66.67}
from vietquill import AutoModelForParaphraseQualityEstimation

original = "Hôm nay trời đẹp quá, mình muốn đi dạo công viên."
paraphrase = "Thời tiết hôm nay thật tuyệt, tôi muốn tản bộ trong công viên."

estimator = AutoModelForParaphraseQualityEstimation()
result = estimator.estimate(original, paraphrase)
print(result)
# >>> {'lexical_score': 24.48, 'syntactic_score': 78.26, 'semantic_score': 64.2}

Model list

Model Architecture Size
vietquill-vit5-base-tsubaki T5-base (~440M parameters) 4.19 GB*
vietquill-velectra-estimator-tsubaki vELECTRA-base (~220M parameters) 1.64 GB*
  • Each Hub repository bundles both sentence and question variants in a single model package.

Why should I use VietQuill?

VietQuill is designed to be the most comprehensive and effective toolkit for Vietnamese paraphrase generation and evaluation. Here is why you should choose it:

  • Seamless Integration: Designed with a clean and intuitive API, allowing VietQuill to be easily integrated into existing NLP workflows, research pipelines, and production systems.
  • State-of-the-Art Paraphrase Generation: Built upon strong Vietnamese language models and quality-controlled generation techniques to deliver high-quality, diverse, and semantically faithful paraphrases.

Citation

Please CITE our paper when VietQuill is used to help produce published results or is incorporated into other software.

@software{sang2026vietquill,
  author = {Nguyen Quang Sang},
  title = {VietQuill: A Toolkit for Vietnamese Paraphrase Generation and Evaluation},
  year = {2026},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/ngwgsang/vietquill}}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vietquill-0.2.0.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vietquill-0.2.0-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file vietquill-0.2.0.tar.gz.

File metadata

  • Download URL: vietquill-0.2.0.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for vietquill-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7dd230ea52cf37de8cb6e45d9e72de957535b969905af6c0b2ad75467528be5e
MD5 3d9bead3c0c624e18f55e80fa6c32cc5
BLAKE2b-256 64d9385e109eaf7ebc217b9248f09e8c26d93c033f987deaf96b78531441b47d

See more details on using hashes here.

File details

Details for the file vietquill-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: vietquill-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for vietquill-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a7c73651dfdf4c7ca48945d5115dbf51d60ed46eb2ab4e6c72a7c5f24675eae
MD5 cbac0a9f5e7d66276ad33ce926e6d10f
BLAKE2b-256 4870de2d5c142e8901a687941213c02645e66ebc34d7fb539f0d7ac832ba3329

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page