645bb9d8ed95b35373bafb493173ab7d61703e8c,analyze_chunker_coverage.py,,,#,14

Before Change


if args.trace:
	print("analyzing chunker coverage of %s with %s\n" % (args.corpus, chunker.__class__.__name__))

iobs_found = FreqDist()
sents = corpus.sents()

if args.fraction != 1.0:
	cutoff = int(math.ceil(len(sents) * args.fraction))
	sents = sents[:cutoff]

for sent in sents:
	tree = chunker.parse(tagger.tag(sent))
	
	for child in tree.subtrees(lambda t: t.node != "S"):
		iobs_found.inc(child.node)

iobs = iobs_found.samples()
justify = max(7, *[len(iob) for iob in iobs])

After Change


if args.trace:
	print("analyzing chunker coverage of %s with %s\n" % (args.corpus, chunker.__class__.__name__))

iobs_found = collections.defaultdict(int)
sents = corpus.sents()

if args.fraction != 1.0:
	cutoff = int(math.ceil(len(sents) * args.fraction))
	sents = sents[:cutoff]

for sent in sents:
	tree = chunker.parse(tagger.tag(sent))
	
	for child in tree.subtrees(lambda t: node_label(t) != "S"):
		iobs_found[node_label(child)] += 1

iobs = iobs_found.keys()
justify = max(7, *[len(iob) for iob in iobs])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: japerk/nltk-trainer
Commit Name: 645bb9d8ed95b35373bafb493173ab7d61703e8c
Time: 2014-01-05
Author: japerk@gmail.com
File Name: analyze_chunker_coverage.py
Class Name:
Method Name:


Project Name: japerk/nltk-trainer
Commit Name: bc128d9596ed07d1c8d5d98f35b1f6905ad4d819
Time: 2014-01-05
Author: japerk@gmail.com
File Name: analyze_tagged_corpus.py
Class Name:
Method Name:


Project Name: japerk/nltk-trainer
Commit Name: 2ca3b0d5a88d414a87c343981b80ed1204b8dd8d
Time: 2014-01-05
Author: japerk@gmail.com
File Name: analyze_chunked_corpus.py
Class Name:
Method Name:


Project Name: japerk/nltk-trainer
Commit Name: 645bb9d8ed95b35373bafb493173ab7d61703e8c
Time: 2014-01-05
Author: japerk@gmail.com
File Name: analyze_chunker_coverage.py
Class Name:
Method Name: