class documentation

Corpus reader for the nombank corpus, which augments the Penn Treebank with information about the predicate argument structure of every noun instance. The corpus consists of two parts: the predicate-argument annotations themselves, and a set of "frameset files" which define the argument labels used by the annotations, on a per-noun basis. Each "frameset file" contains one or more predicates, such as 'turn' or 'turn_on', each of which is divided into coarse-grained word senses called "rolesets". For each "roleset", the frameset file provides descriptions of the argument roles, along with examples.

Method __init__ No summary
Method instances NombankInstance objects, one for each noun in the corpus.
Method lines each line in the predicate-argument annotation file.
Method nouns in this corpus (from the nombank.1.0.words file).
Method raw No summary
Method roleset No summary
Method rolesets No summary
Method _read_instance_block Undocumented
Instance Variable _fileids A list of the relative paths for the fileids that make up this corpus.
Instance Variable _nomfile Undocumented
Instance Variable _nounsfile Undocumented
Instance Variable _parse_corpus Undocumented
Instance Variable _parse_fileid_xform Undocumented

Inherited from CorpusReader:

Method __repr__ Undocumented
Method abspath Return the absolute path for the given file.
Method abspaths Return a list of the absolute paths for all fileids in this corpus; or for the given list of fileids, if specified.
Method citation Return the contents of the corpus citation.bib file, if it exists.
Method encoding Return the unicode encoding for the given corpus file, if known. If the encoding is unknown, or if the given file should be processed using byte strings (str), then return None.
Method ensure_loaded Load this corpus (if it has not already been loaded). This is used by LazyCorpusLoader as a simple method that can be used to make sure a corpus is loaded -- e.g., in case a user wants to do help(some_corpus).
Method fileids Return a list of file identifiers for the fileids that make up this corpus.
Method license Return the contents of the corpus LICENSE file, if it exists.
Method open Return an open stream that can be used to read the given file. If the file's encoding is not None, then the stream will automatically decode the file's contents into unicode.
Method readme Return the contents of the corpus README file, if it exists.
Class Variable root Undocumented
Method _get_root Undocumented
Instance Variable _encoding The default unicode encoding for the fileids that make up this corpus. If encoding is None, then the file contents are processed using byte strings.
Instance Variable _root The root directory for this corpus.
Instance Variable _tagset Undocumented
def __init__(self, root, nomfile, framefiles='', nounsfile=None, parse_fileid_xform=None, parse_corpus=None, encoding='utf8'): (source)
Parameters
rootThe root directory for this corpus.
nomfileThe name of the file containing the predicate- argument annotations (relative to root).
framefilesA list or regexp specifying the frameset fileids for this corpus.
nounsfileUndocumented
parse_fileid_xformA transform that should be applied to the fileids in this corpus. This should be a function of one argument (a fileid) that returns a string (the new fileid).
parse_corpusThe corpus containing the parse trees corresponding to this corpus. These parse trees are necessary to resolve the tree pointers used by nombank.
encodingUndocumented
def instances(self, baseform=None): (source)

NombankInstance objects, one for each noun in the corpus.

Returns
a corpus view that acts as a list of
def lines(self): (source)

each line in the predicate-argument annotation file.

Returns
a corpus view that acts as a list of strings, one for
def nouns(self): (source)

in this corpus (from the nombank.1.0.words file).

Returns
a corpus view that acts as a list of all noun lemmas
def raw(self, fileids=None): (source)
Returns
the text contents of the given fileids, as a single string.
def roleset(self, roleset_id): (source)
Returns
the xml description for the given roleset.
def rolesets(self, baseform=None): (source)
Returns
list of xml descriptions for rolesets.
def _read_instance_block(self, stream, instance_filter=(lambda inst: True)): (source)

Undocumented

_fileids = (source)

A list of the relative paths for the fileids that make up this corpus.

_nomfile = (source)

Undocumented

_nounsfile = (source)

Undocumented

_parse_corpus = (source)

Undocumented

_parse_fileid_xform = (source)

Undocumented