Skip to content
Snippets Groups Projects

Change output type from json txt to jsonl

1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
+ 2
2
@@ -31,7 +31,7 @@ class EasymatcherWorker(nlp_ws.NLPWorker):
document["text"] = _df.read()
with open(file_path, "a", encoding="utf-8") as _f:
_f.write(f"{json.dumps(document)}\n")
_f.write(json.dumps(document) + "\n")
def process(
self,
@@ -84,4 +84,4 @@ class EasymatcherWorker(nlp_ws.NLPWorker):
with open(output_path, "w", encoding="utf-8") as _f:
for out_document in out_documents:
_f.write(f"{json.dumps(out_document)}\n")
_f.write(json.dumps(out_document) + "\n")
Loading