Created
September 19, 2017 14:02
-
-
Save minhlab/faa15843cbeedd52c07d89dfa56abb1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
num_npb = 0 | |
num_files = 0 | |
for root, _, fnames in os.walk('.'): | |
for fname in fnames: | |
if '.parse' in fname: | |
with open(os.path.join(root, fname)) as f: | |
s = f.read() | |
num_npb += s.count('NPB') | |
num_files += 1 | |
print('Examined %d files' %num_files) | |
print('Found %d instances of NPB' %num_npb) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ran on OntoNotes: