--- language: - th pipeline_tag: summarization tags: - summarization - pegasus_x --- widget: - text: >- ผมกินตับหมูดิบแล้วหมดสติไป พอฟื้นอีกทีในต่างโลกดันกลายเป็นหมูซะงั้น! คนที่ช่วยผมเอาไว้คือเจส สาวน้อยผู้อ่านใจคนได้ อู๊ด! น่ารัก! ระดับสายตาหมูทำให้เห็นอะไรสีขาวบริสุทธิ์แวบๆ แจ่มเลย... “เอ่อ ฉันได้ยินเสียงในใจของคุณนะคะ…” ฉิบแล้ว! ความมักมากรั่วไหลหมด! แม้ว่าชีวิตประสาหมูที่มีเด็กสาวผู้อ่อนโยนคอยดูแลจะไม่เลว ผมก็ตัดสินใจมุ่งหน้าสู่นครหลวงพร้อมกับเจสเพื่อหาทางกลับเป็นมนุษย์ การเดินทางแสนรื่นรมย์จึงเริ่มต้นขึ้น... แต่ไหงเราถึงถูกตามล่าเอาชีวิตล่ะเนี่ย!? example_title: Novel This repository features a fine-tuned Pegasus X model designed for summarizing Thai text. The architecture of the model is based on the Pegasus X model. # Library ``` pip install transformers ``` # Example ```python from transformers import PegasusXForConditionalGeneration, AutoTokenizer model = PegasusXForConditionalGeneration.from_pretrained("satjawat/pegasus-x-thai-sum") tokenizer = AutoTokenizer.from_pretrained("satjawat/pegasus-x-thai-sum") new_input_string = "ข้อความ" new_input_ids = tokenizer(new_input_string.lower(), return_tensors="pt").input_ids summary_ids = model.generate(new_input_ids, max_length=50, num_beams=6, length_penalty=2.0, early_stopping=True) summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True) print("Input:", new_input_string) print("Generated Summary:", summary) ``` # Training hyperparameters The following hyperparameters were used during training: