We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00899f7 commit 4948103Copy full SHA for 4948103
src/parserindexer/json2brat.py
@@ -6,7 +6,7 @@
6
# Kiri Wagstaff
7
# July 31, 2017
8
9
-import sys, os, shutil
+import sys, os, shutil, io
10
import json
11
from ioutils import read_jsonlines
12
@@ -31,7 +31,7 @@ def convert_json_to_brat(jsonfile, outdir):
31
ners = d['metadata']['ner']
32
outfn = os.path.join(outdir,
33
d['metadata']['resourceName'][:-4] + '.ann')
34
- outf = open(outfn, 'w')
+ outf = io.open(outfn, 'w', encoding='utf8')
35
print 'Writing to', outfn
36
for (t, n) in enumerate(ners):
37
outf.write('T%d\t%s %s %s\t%s\n' % \
0 commit comments