verbnetframe¶
- class verbnetframe.ComputeSlotTypeMixin[source]¶
Bases: builtins.object
- _abc_cache = <_weakrefset.WeakSet object at 0x7fd4f39daf98>¶
- _abc_negative_cache = <_weakrefset.WeakSet object at 0x7fd4f39daef0>¶
- _abc_negative_cache_version = 25¶
- _abc_registry = <_weakrefset.WeakSet object at 0x7fd4f39dac50>¶
- static _is_a_slot(elem)[source]¶
Tell wether an element represent a slot
Parameters: elem (str.) – The element. Returns: bool – True if elem represents a slot, False otherwise
- slot_types = {'indirect_object': 'OBJI', 'subject': 'SBJ', 'prep_object': 'PPOBJ', 'object': 'OBJ'}¶
- class verbnetframe.VerbnetFrameOccurrence(structure, roles, predicate)[source]¶
Bases: verbnetframe.ComputeSlotTypeMixin
A representation of a FrameNet frame occurrence converted to VerbNet representation for easy comparison.
Variables: - structure – (str | str set) list – representation of the structure
- roles – set list – possible VerbNet roles for each structure’s slot
- num_slots – int – number of argument slots in :structure
- predicate – str – the predicate
- headwords – str – the head word of each argument
- _abc_cache = <_weakrefset.WeakSet object at 0x7fd4f39e9b38>¶
- _abc_negative_cache = <_weakrefset.WeakSet object at 0x7fd4f39e9b70>¶
- _abc_negative_cache_version = 25¶
- _abc_registry = <_weakrefset.WeakSet object at 0x7fd4f39e9b00>¶
- static _keep_only_keywords(sentence)[source]¶
Keep only keywords and phrase type markers in the structure
Parameters: sentence (str.) – The structure to reduce. Returns: String – the reduced string
- static _reduce_args(frame, structure, new_begin)[source]¶
Replace the predicate and the argument of a frame by phrase type marks
Parameters: - frame (Frame.) – The original Frame.
- structure (str.) – The current structure representation.
- new_begin (int.) – The left offset cause by previous manipulations.
Returns: String – the reduced string
- static build_from_frame(gold_framenet_instance, conll_frame_instance)[source]¶
Build a VerbNet frame from a FrameInstance object
Parameters: - gold_framenet_instance – The gold FrameNet frame instance
- conll_frame_instance – The frame instance from CoNLL
Returns: VerbnetFrameOccurrence – the frame without the gold roles
converted to VerbNet-style representation
- phrase_replacements = {'QUO': 'S', 'N': 'NP', 'Sinterrog': 'S', 'Poss': 'NP', 'VPto': 'to S', 'VPing': 'S_ING', 'VPbrst': 'S', 'Sfin': 'S'}¶
- class verbnetframe.VerbnetOfficialFrame(structure, roles, vnclass, role_restrictions)[source]¶
Bases: verbnetframe.ComputeSlotTypeMixin
A representation of a frame syntactic structure
Variables: - structure – (str | str set) List – representation of the structure
- roles – str list – VerbNet roles for each structure’s slot
- num_slots – int – number of argument slots in :structure
- vnclass – str – the class number, eg. 9.10
- example – str – An example sentence that illustrates the frame
- _abc_cache = <_weakrefset.WeakSet object at 0x7fd4f39e9ba8>¶
- _abc_negative_cache = <_weakrefset.WeakSet object at 0x7fd4f39e9c18>¶
- _abc_negative_cache_version = 25¶
- _abc_registry = <_weakrefset.WeakSet object at 0x7fd4f39e9be0>¶