Beispiel für eine Text-zu-SQL-Übersetzung mit Huggingface-Transformatoren
In diesem Artikel folge ich dem detaillierten Notizbuch von Manuel Romero genau und führe kleinere Änderungen durch, wie z. B. den Ersatz des kleinen T5-Modells durch das T5-Basismodell (wodurch die Anzahl der trainierbaren Parameter von 60 Millionen auf etwa 223 Millionen erhöht wird ). Ausführliche Informationen zur Analyse finden Sie in diesem öffentlichen Kaggle-Notizbuch .
Als Ergebnis des Trainings über 5 Epochen (wobei etwa 2 Stunden der für Kaggle-Benutzer verfügbaren NVIDIA TESLA P100-GPU benötigt wurden ) liegt der entsprechende ROUGE2- Fscore bei etwa 0,7904 oder 2,86 Prozentpunkten höher als im ursprünglichen Notebook :
Einige der vorhergesagten Beispiele für die vom trainierten Modell durchgeführte Text-zu-SQL-Übersetzung zusammen mit den erwarteten SQL-Abfragen:
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
Ich hoffe, dass diese Ergebnisse für Sie nützlich sein können. Wenn Sie Fragen/Kommentare haben, zögern Sie nicht, in die Kommentare unten zu schreiben oder mich direkt über LinkedIn oder Twitter zu kontaktieren .
Sie können auch meine neuen Artikel abonnieren oder ein empfohlenes Medium-Mitglied werden .

![Was ist überhaupt eine verknüpfte Liste? [Teil 1]](https://post.nghiatu.com/assets/images/m/max/724/1*Xokk6XOjWyIGCBujkJsCzQ.jpeg)



































