class documentation

This class is an interface to Johan Bos's program Boxer, a wide-coverage semantic parser that produces Discourse Representation Structures (DRSs).

Method __init__ AbstractBoxerDrs object hierarchy to a different object. The default is NltkDrtBoxerDrsInterpreter, which converts to the NLTK DRT hierarchy. :param elimeq: When set to true, Boxer removes all equalities from the DRSs and discourse referents standing in the equality relation are unified, but only if this can be done in a meaning-preserving manner...
Method interpret Use Boxer to give a first order representation.
Method interpret_multi Use Boxer to give a first order representation.
Method interpret_multi_sents Use Boxer to give a first order representation.
Method interpret_sents Use Boxer to give a first order representation.
Method set_bin_dir Undocumented
Method _call Call the binary with the given input.
Method _call_boxer Call the boxer binary with the given input.
Method _call_candc Call the candc binary with the given input.
Method _find_binary Undocumented
Method _parse_drs Undocumented
Method _parse_to_drs_dict Undocumented
Instance Variable _boxer_bin Undocumented
Instance Variable _boxer_drs_interpreter Undocumented
Instance Variable _candc_bin Undocumented
Instance Variable _candc_models_path Undocumented
Instance Variable _elimeq Undocumented
Instance Variable _resolve Undocumented
def __init__(self, boxer_drs_interpreter=None, elimeq=False, bin_dir=None, verbose=False, resolve=True): (source)

AbstractBoxerDrs object hierarchy to a different object. The default is NltkDrtBoxerDrsInterpreter, which converts to the NLTK DRT hierarchy. :param elimeq: When set to true, Boxer removes all equalities from the DRSs and discourse referents standing in the equality relation are unified, but only if this can be done in a meaning-preserving manner. :param resolve: When set to true, Boxer will resolve all anaphoric DRSs and perform merge-reduction. Resolution follows Van der Sandt's theory of binding and accommodation.

Parameters
boxer_drs_interpreterA class that converts from the
elimeqUndocumented
bin_dirUndocumented
verboseUndocumented
resolveUndocumented
def interpret(self, input, discourse_id=None, question=False, verbose=False): (source)

Use Boxer to give a first order representation.

Parameters
inputstr Input sentence to parse
discourse_idstr An identifier to be inserted to each occurrence-indexed predicate.
questionUndocumented
verboseUndocumented
occur_indexbool Should predicates be occurrence indexed?
Returns
drt.DrtExpression
def interpret_multi(self, input, discourse_id=None, question=False, verbose=False): (source)

Use Boxer to give a first order representation.

Parameters
inputlist of str Input sentences to parse as a single discourse
discourse_idstr An identifier to be inserted to each occurrence-indexed predicate.
questionUndocumented
verboseUndocumented
occur_indexbool Should predicates be occurrence indexed?
Returns
drt.DrtExpression
def interpret_multi_sents(self, inputs, discourse_ids=None, question=False, verbose=False): (source)

Use Boxer to give a first order representation.

Parameters
inputslist of list of str Input discourses to parse
discourse_idslist of str Identifiers to be inserted to each occurrence-indexed predicate.
questionUndocumented
verboseUndocumented
occur_indexbool Should predicates be occurrence indexed?
Returns
drt.DrtExpression
def interpret_sents(self, inputs, discourse_ids=None, question=False, verbose=False): (source)

Use Boxer to give a first order representation.

Parameters
inputslist of str Input sentences to parse as individual discourses
discourse_idslist of str Identifiers to be inserted to each occurrence-indexed predicate.
questionUndocumented
verboseUndocumented
occur_indexbool Should predicates be occurrence indexed?
Returns
list of drt.DrtExpression
def set_bin_dir(self, bin_dir, verbose=False): (source)

Undocumented

def _call(self, input_str, binary, args=[], verbose=False): (source)

Call the binary with the given input.

Parameters
input_strA string whose contents are used as stdin.
binaryThe location of the binary to call
argsA list of command-line arguments.
verboseUndocumented
Returns
stdout
def _call_boxer(self, candc_out, verbose=False): (source)

Call the boxer binary with the given input.

Parameters
candc_outstr output from C&C parser
verboseUndocumented
Returns
stdout
def _call_candc(self, inputs, discourse_ids, question, verbose=False): (source)

Call the candc binary with the given input.

Parameters
inputslist of list of str Input discourses to parse
discourse_idslist of str Identifiers to be inserted to each occurrence-indexed predicate.
questionUndocumented
verboseUndocumented
filenamestr A filename for the output file
Returns
stdout
def _find_binary(self, name, bin_dir, verbose=False): (source)

Undocumented

def _parse_drs(self, drs_string, discourse_id, use_disc_id): (source)

Undocumented

def _parse_to_drs_dict(self, boxer_out, use_disc_id): (source)

Undocumented

_boxer_bin = (source)

Undocumented

_boxer_drs_interpreter = (source)

Undocumented

_candc_bin = (source)

Undocumented

_candc_models_path = (source)

Undocumented

Undocumented

_resolve = (source)

Undocumented