class PropbankCorpusReader(CorpusReader): (source)
Constructor: PropbankCorpusReader(root, propfile, framefiles, verbsfile, ...)
Corpus reader for the propbank corpus, which augments the Penn Treebank with information about the predicate argument structure of every verb 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-verb 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 |
PropBankInstance objects, one for each noun in the corpus. |
Method | lines |
each line in the predicate-argument annotation file. |
Method | raw |
No summary |
Method | roleset |
No summary |
Method | rolesets |
No summary |
Method | verbs |
in this corpus (from the verbs.txt file). |
Method | _read |
Undocumented |
Instance Variable | _framefiles |
Undocumented |
Instance Variable | _parse |
Undocumented |
Instance Variable | _parse |
Undocumented |
Instance Variable | _propfile |
Undocumented |
Instance Variable | _verbsfile |
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 |
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 |
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 | _fileids |
A list of the relative paths for the fileids that make up this corpus. |
Instance Variable | _root |
The root directory for this corpus. |
Instance Variable | _tagset |
Undocumented |
nltk.corpus.reader.CorpusReader.__init__
Parameters | |
root | The root directory for this corpus. |
propfile | The name of the file containing the predicate- argument annotations (relative to root). |
framefiles | A list or regexp specifying the frameset fileids for this corpus. |
verbsfile | Undocumented |
parse | A 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 | The corpus containing the parse trees corresponding to this corpus. These parse trees are necessary to resolve the tree pointers used by propbank. |
encoding | Undocumented |
PropBankInstance objects, one for each noun in the corpus.
Returns | |
a corpus view that acts as a list of |
each line in the predicate-argument annotation file.
Returns | |
a corpus view that acts as a list of strings, one for |
in this corpus (from the verbs.txt file).
Returns | |
a corpus view that acts as a list of all verb lemmas |