4eb0ded34a9cbf62bb8bfda48b7ef4b17e43a37c,stanfordnlp/utils/prepare_ner_data.py,,main,#,19

Before Change


    with open(args.output, "w") as outfile:
        for (words, tags) in sentences:
            for i, (w, t) in enumerate(zip(words, tags)):
                print("{}\t{}\t{}\tner={}".format(i+1, w, "\t".join([filler]*7), t), file=outfile)
            print("", file=outfile)
    print("Generated conllu file {}.".format(args.output))

def load_conll03(filename, skip_doc_start=True):

After Change


    sentences = load_conll03(args.input)
    print("{} examples loaded from {}".format(len(sentences), args.input))
    
    document = []
    for (words, tags) in sentences:
        sent = []
        for w, t in zip(words, tags):
            sent += [{"text": w, "ner": t}]
        document += [sent]

    with open(args.output, "w") as outfile:
        json.dump(document, outfile)
    print("Generated json file {}.".format(args.output))

def load_conll03(filename, skip_doc_start=True):
    cached_lines = []
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: stanfordnlp/stanza
Commit Name: 4eb0ded34a9cbf62bb8bfda48b7ef4b17e43a37c
Time: 2019-08-26
Author: zyh@stanford.edu
File Name: stanfordnlp/utils/prepare_ner_data.py
Class Name:
Method Name: main


Project Name: acl-org/acl-anthology
Commit Name: 340d46fde1be0940629c93004d453cef65b09442
Time: 2019-03-28
Author: dchiang@nd.edu
File Name: bin/auto_name_variants.py
Class Name:
Method Name:


Project Name: acl-org/acl-anthology
Commit Name: bfd66ac88c9f4d337150db9353a5247634633f57
Time: 2019-03-26
Author: dchiang@nd.edu
File Name: bin/auto_name_variants.py
Class Name:
Method Name: