Exemple de traduction de texte en SQL avec les transformateurs Huggingface
Dans cet article, je suis de près le cahier détaillé de Manuel Romero avec des ajustements mineurs, comme le remplacement du petit modèle T5 par le modèle de base T5 (augmentant ainsi le nombre de paramètres pouvant être entraînés de 60M à environ 223M ). Tous les détails de l'analyse peuvent être trouvés dans ce cahier public de Kaggle .
À la suite d'une formation pendant 5 époques (prenant environ 2 heures de GPU NVIDIA TESLA P100 disponible pour les utilisateurs de Kaggle ), le ROUGE2 Fscore correspondant est d'environ 0,7904 , soit 2,86 points de pourcentage de plus que celui obtenu dans le cahier initial :
Certains des exemples prédits de traduction texte-SQL effectuée par le modèle entraîné, ainsi que les requêtes SQL attendues :
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
J'espère que ces résultats pourront vous être utiles. En cas de questions/commentaires, n'hésitez pas à écrire dans les commentaires ci-dessous ou à me joindre directement via LinkedIn ou Twitter .
Vous pouvez également vous abonner à mes nouveaux articles , ou devenir membre Medium référé .
![Qu'est-ce qu'une liste liée, de toute façon? [Partie 1]](https://post.nghiatu.com/assets/images/m/max/724/1*Xokk6XOjWyIGCBujkJsCzQ.jpeg)



































