Skip to content
Snippets Groups Projects
Commit 76cba42e authored by Bartlomiej's avatar Bartlomiej
Browse files

Add clarin_json

parent 5055c2b1
Branches
1 merge request!11Clarin json support
Pipeline #14190 failed with stages
in 17 seconds
......@@ -7,7 +7,7 @@ from src.input_parsers.interface import InputParser
from src.pipeline.interface import Pipeline
from src.replacers.interface import ReplacerInterface
from src.suppressors.interface import Suppressor
import clarin_json
class SequentialJSONLPipeline(Pipeline):
"""Pipeline that runs the whole anonymization process on jsonl-splitted input.
......@@ -55,12 +55,10 @@ class SequentialJSONLPipeline(Pipeline):
"""
result = []
with open(input_path, "r") as f:
for line in f.readlines():
if line.strip() == "":
continue
parsed_input = self._input_parser.parse(line)
with clarin_json.open(input_path, 'r') as f:
for line in f:
parsed_input = self._input_parser.parse(line)
detected_entities = []
for detector_name, detector in self._detectors.items():
detected_entities += detector.detect(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment