Improve synthetic context consistency
Browse files- data/test.jsonl +0 -0
- data/train.jsonl +0 -0
- data/validation.jsonl +0 -0
- scripts/generate.py +6 -3
data/test.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/validation.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
scripts/generate.py
CHANGED
|
@@ -63,8 +63,9 @@ def generate():
|
|
| 63 |
for i in range(400):
|
| 64 |
text = RNG.choice(pool)
|
| 65 |
context = RNG.choice(["รีวิวร้านค้า", "ความคิดเห็นลูกค้า", "ข้อความหลังรับบริการ", "ประสบการณ์ผู้ใช้"])
|
| 66 |
-
|
| 67 |
-
|
|
|
|
| 68 |
rows.append(row("sentiment_classification", q, label, 0.98))
|
| 69 |
|
| 70 |
# Translation with compositional but natural short sentences.
|
|
@@ -115,7 +116,9 @@ def generate():
|
|
| 115 |
rows.append(row("summarization", f"สรุปข้อความต่อไปนี้เป็นหนึ่งประโยค: {text}", f"{actor}ใน{place}จัดกิจกรรม{topic} {weeks} สัปดาห์ให้ผู้เข้าร่วม {participants} คนเรียนรู้และนำไปใช้จริง", 0.93))
|
| 116 |
for _ in range(500):
|
| 117 |
topic, benefit = RNG.choice(TOPICS)
|
| 118 |
-
audience
|
|
|
|
|
|
|
| 119 |
rows.append(row("explanation", f"อธิบายประโยชน์ของ{topic}แบบเข้าใจง่ายสำหรับ{audience}อายุ {age} ปี", benefit, 0.95))
|
| 120 |
|
| 121 |
# Formal rewriting and practical conversation.
|
|
|
|
| 63 |
for i in range(400):
|
| 64 |
text = RNG.choice(pool)
|
| 65 |
context = RNG.choice(["รีวิวร้านค้า", "ความคิดเห็นลูกค้า", "ข้อความหลังรับบริการ", "ประสบการณ์ผู้ใช้"])
|
| 66 |
+
place, day = RNG.choice(PLACES), RNG.randint(1, 31)
|
| 67 |
+
channel = RNG.choice(["หน้าร้าน", "แอปพลิเคชัน", "โทรศัพท์", "แบบสอบถาม"])
|
| 68 |
+
q = f"จำแนกความรู้สึกเป็น บวก กลาง หรือลบ\nประเภทข้อความ: {context}\nช่องทาง: {channel}\nพื้นที่: {place}\nวันที่: {day}\nข้อความ: {text}"
|
| 69 |
rows.append(row("sentiment_classification", q, label, 0.98))
|
| 70 |
|
| 71 |
# Translation with compositional but natural short sentences.
|
|
|
|
| 116 |
rows.append(row("summarization", f"สรุปข้อความต่อไปนี้เป็นหนึ่งประโยค: {text}", f"{actor}ใน{place}จัดกิจกรรม{topic} {weeks} สัปดาห์ให้ผู้เข้าร่วม {participants} คนเรียนรู้และนำไปใช้จริง", 0.93))
|
| 117 |
for _ in range(500):
|
| 118 |
topic, benefit = RNG.choice(TOPICS)
|
| 119 |
+
audience = RNG.choice(["นักเรียน", "ผู้เริ่มต้น", "ผู้สูงอายุ", "คนทำงาน"])
|
| 120 |
+
age_ranges = {"นักเรียน": (8, 18), "ผู้เริ่มต้น": (18, 65), "ผู้สูงอายุ": (60, 85), "คนทำงาน": (20, 65)}
|
| 121 |
+
age = RNG.randint(*age_ranges[audience])
|
| 122 |
rows.append(row("explanation", f"อธิบายประโยชน์ของ{topic}แบบเข้าใจง่ายสำหรับ{audience}อายุ {age} ปี", benefit, 0.95))
|
| 123 |
|
| 124 |
# Formal rewriting and practical conversation.
|