File size: 330 Bytes
37cea5d
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import json

input_file = 'kilt_wikipedia_entites.txt'
output_file = 'kilt_wikipedia_entites.jsonl'

with open(input_file, 'r') as input_text, open(output_file, 'w') as output_jsonl:
    for line in input_text:
        #entry = {"word": line.strip()}
        json.dump(line.strip(), output_jsonl)
        output_jsonl.write('\n')