You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
987 B
20 lines
987 B
import os |
|
import csv |
|
|
|
fichier = "fineTuning/data_appreciations_tuning_v2.csv" |
|
fichier_out = "fineTuning/finetuning_appreciations_tuning_v2.jsonl" |
|
|
|
with open(fichier, 'r') as file: |
|
reader = csv.reader(file,delimiter=';') |
|
data = list(reader) |
|
|
|
output = [] |
|
|
|
content = "rédige un commentaire de bulletin de collégien, maximum 300 caractères, tutoiement de l'élève, commentaire sur la moyenne trimestrielle ne pas indiquer de valeur chiffrée." |
|
for i in range(1, len(data)): |
|
prompt = data[i][0]+", moyenne du trimestre "+data[i][1]+"/20, moyenne annuelle "+data[i][1]+"/20, comportement en classe niveau "+data[i][2]+"/3, participation orale niveau "+data[i][3]+"/3, travail founi niveau "+data[i][4] |
|
output.append('{"messages": [{"role": "system", "content": "'+content+'"},{"role": "user", "content": "'+prompt+'"},{"role": "assistant", "content": "'+data[i][5]+'"}]}') |
|
|
|
with open(fichier_out, 'w') as fp: |
|
for item in output: |
|
fp.write("%s\n" % item)
|
|
|