49d41416e440926f0a9a8243b4d77f6f5468efe9,app/server/utils.py,CoNLLHandler,parse,#CoNLLHandler#Any#,100

Before Change


    def parse(self, file):
        words, tags = [], []
        for i, line in enumerate(file, start=1):
            line = line.decode("utf-8")
            line = line.strip()
            if line:
                try:
                    word, tag = line.split("\t")

After Change


class JSONParser(FileParser):

    def parse(self, file):
        data = []
        for i, line in enumerate(file, start=1):
            if len(data) >= IMPORT_BATCH_SIZE:
                yield data
                data = []
            try:
                j = json.loads(line)
                j["meta"] = json.dumps(j.get("meta", {}))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: chakki-works/doccano
Commit Name: 49d41416e440926f0a9a8243b4d77f6f5468efe9
Time: 2019-03-12
Author: light.tree.1.13@gmail.com
File Name: app/server/utils.py
Class Name: CoNLLHandler
Method Name: parse


Project Name: Calamari-OCR/calamari
Commit Name: e3673091d04ef00cea5d7d8bcac69c0dee40e585
Time: 2021-01-19
Author: wick.chr@gmail.com
File Name: calamari_ocr/utils/multiprocessing.py
Class Name:
Method Name: run


Project Name: Calamari-OCR/calamari
Commit Name: 1b305c86dc2ff6b3461c42f4428460b66a8bff8b
Time: 2020-01-31
Author: wick.chr.info@gmail.com
File Name: calamari_ocr/ocr/backends/tensorflow_backend/tensorflow_model.py
Class Name: TensorflowModel
Method Name: predict_dataset