Skip to main content

VietQuill: An Open-Source Toolkit for Vietnamese Paraphrasing

Project description

VietQuill: A toolkit for Vietnamese Paraphrase Generation and Evaluation

An Open-Source Toolkit for Vietnamese Paraphrasing

PyPI Python License

Vietnamese Task Models

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.paraphrase(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.paraphrase(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
ngwgsang/vietquill-vit5-base-tsubaki T5-base (~440M parameters) 4.19 GB*
ngwgsang/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: An Open-Source Toolkit for Vietnamese Paraphrasing},
  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.1.tar.gz (18.8 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.1-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vietquill-0.2.1.tar.gz
  • Upload date:
  • Size: 18.8 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.1.tar.gz
Algorithm Hash digest
SHA256 762e1f1cec9ee4f7583ccb2826674910abc5a8c2ff069e464865fd1a2e11acdc
MD5 ab070ff84005f0b7078124cc4ece5ea0
BLAKE2b-256 183a825fcce3a7b4101cbae514b650c7bcf23ebc4c7303bc8309796231c54f09

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vietquill-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 23.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a7a52fd2578217bf05abbb31cf049f3b5b34372cbecaf6a7e492c43a02e8d2fd
MD5 92a751d33b801e246c81e010a1d6c46e
BLAKE2b-256 a0306b18a503955fe134c62c002373580e56d20897b6e8032f9d0930f45c491a

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