ตัวอย่างการแปลข้อความเป็น SQL ด้วย Huggingface transformers
ในบทความนี้ ฉันติดตามโน้ตบุ๊กโดยละเอียดจากManuel Romeroด้วยการปรับแต่งเล็กน้อย เช่น แทนที่รุ่น T5 ขนาดเล็กด้วยรุ่นพื้นฐาน T5 (ซึ่งจะเป็นการเพิ่มจำนวนพารามิเตอร์ที่ฝึกได้จาก60Mเป็นประมาณ223M ) สามารถดูรายละเอียดทั้งหมดของการวิเคราะห์ได้ในสมุดบันทึก Kaggle สาธารณะนี้
ผลจากการฝึกอบรมในช่วง5 ยุค (ใช้เวลาประมาณ 2 ชั่วโมงของGPU NVIDIA TESLA P100 ที่มีให้สำหรับผู้ใช้ Kaggle ) คะแนนROUGE2 Fscore ที่สอดคล้องกัน คือประมาณ 0.7904หรือสูงกว่าที่ได้รับในโน้ตบุ๊กเริ่มต้น2.86 เปอร์เซ็นต์ :

ตัวอย่างบางส่วนที่คาดการณ์ไว้ของการแปลข้อความเป็น SQL ที่ดำเนินการโดยโมเดลที่ผ่านการฝึกอบรม ร่วมกับการสืบค้น SQL ที่คาดไว้:
translate to SQL: What is terrence ross' nationality
Predicted: SELECT Nationality FROM table WHERE Player = Terrence Ross
Expected: SELECT Nationality FROM table WHERE Player = Terrence Ross
translate to SQL: how many schools or teams had jalen rose
Predicted: SELECT COUNT School/Club Team FROM table WHERE Player = Jalen Rose
Expected: SELECT COUNT School/Club Team FROM table WHERE Player = Jalen Rose
translate to SQL: What was the date of the race in Misano?
Predicted: SELECT Date FROM table WHERE Location = misano
Expected: SELECT Date FROM table WHERE Circuit = Misano
translate to SQL: How many different college/junior/club teams provided a player to the Washington Capitals NHL Team?
Predicted: SELECT COUNT College/junior/club team FROM table WHERE NHL Team = Washington Capitals
Expected: SELECT COUNT College/junior/club team FROM table WHERE NHL team = Washington Capitals
translate to SQL: What is the nationality of the player from Vancouver Canucks?
Predicted: SELECT Nationality FROM table WHERE NHL team = Vancouver Canucks
Expected: SELECT Nationality FROM table WHERE NHL team = Vancouver Canucks
translate to SQL: List the # for ships commissioned on december 18, 1965.
Predicted: SELECT # FROM table WHERE Commissioned = December 18, 1965
Expected: SELECT # FROM table WHERE Commissioned = December 18, 1965
translate to SQL: What could a spanish coronel be addressed as in the commonwealth military?
Predicted: SELECT Address FROM table WHERE Country = commonwealth military AND Language = spanish coronel
Expected: SELECT Commonwealth equivalent FROM table WHERE Rank in Spanish = Coronel
translate to SQL: If you're a major general in the US air force then what ranking will you receive in the commonwealth's air force?
Predicted: SELECT Air Force Ranking FROM table WHERE Major General = US Air Force
Expected: SELECT Commonwealth equivalent FROM table WHERE US Air Force equivalent = Major General
ฉันหวังว่าผลลัพธ์เหล่านี้จะเป็นประโยชน์สำหรับคุณ ในกรณีที่มีคำถาม/ความคิดเห็น โปรดอย่าลังเลที่จะเขียนความคิดเห็นด้านล่างหรือติดต่อฉันโดยตรงผ่านLinkedInหรือTwitter
คุณยังสามารถสมัครรับบทความใหม่ของฉันหรือเป็นสมาชิกสื่ออ้างอิง