@@ -0,0 +1,1453 @@
+def OntoNotes(directory):%0A    %22%22%22%0A    Parameters%0A    ----------%0A        directory: str%0A            directory in which the OntoNotes project is located%0A        files : str%0A            path to a file containing all of the paths to files containing NER-annotated%0A            data%0A%0A    Yields%0A    ------%0A        sentence  : list of str%0A            original sentence%0A        ner_begin : list of int%0A            start indices of NER, inclusive%0A        ner_end   : list of int%0A            end indices of NER, excusive%0A        ner_label : list of int%0A            The entity type of sentence%5Bner_begin%5Bi%5D:ner_end%5Bi%5D%5D is label%5Bi%5D%0A    %22%22%22%0A%0A    entity2cls = %7B%0A        # OntoNotes labels%0A        'PERSON': 0,%0A        'FAC': 1,%0A        'ORG': 2,%0A        'GPE': 3,%0A        'LOC': 4,%0A        'PRODUCT': 5,%0A        'DATE': 6,%0A        'TIME': 7,%0A        'PERCENT': 8,%0A        'MONEY': 9,%0A        'QUANTITY': 10,%0A        'ORDINAL': 11,%0A        'CARDINAL': 12,%0A        'EVENT': 13,%0A        'WORK_OF_ART': 14,%0A        'LAW': 15,%0A        'LANGUAGE': 16,%0A        'NORP': 17%0A    %7D%0A%0A    sentence, ner_begin, ner_end, ner_label = %5B%5D, %5B%5D, %5B%5D, %5B%5D%0A%0A    for filename in glob.glob(os.path.join(directory, %22cnn_0360.v4_auto_conll%22)):%0A        textfile = open(filename, %22r%22)%0A        for line in textfile:%0A            tokens = line.strip().split()%0A            print(tokens)%0A%0A%0Aif __name__ == '__name__':%0A    OntoNotes(%22/eecs/research/asr/quanliu/Datasets/CoNLL2012/data/development/conll%22)

Add parser