rolematcher¶
Map FrameNet and VerbNet roles
- exception rolematcher.RoleMatchingError(msg)[source]¶
Bases: builtins.Exception
Missing data to compare a vn and a fn role
Variables: msg – str, a message detailing what is missing
- class rolematcher.VnFnRoleMatcher(path)[source]¶
Bases: builtins.object
Reads the mapping between VN and FN roles, and can then be used to compare them
Variables: - fn_roles – data structure used to store the mapping between VN and FN roles
- mappings – associate possible mapping (FN roles -> VN roles) to every FN frames
- issues – used to store statistics about the problem encoutered
- build_frames_vnclasses_mapping()[source]¶
Builds a mapping between framenet frames and associated verbnet classes
- match(fn_role, vn_role, fn_frame=None, vn_classes=None)[source]¶
Tell wether fn_role can be mapped to vn_role in a given context
Parameters: - fn_role (str.) – The FrameNet role.
- fn_frame (str.) – The FrameNet frame in which the roles have to be mapped.
- vn_classes (str List.) – A list of VerbNet classes for which the roles have to be mapped.
Parma vn_role: The VerbNet role.
Returns: bool – True if the two roles can be mapped, False otherwise
- possible_vn_roles(fn_role, fn_frame=None, vn_classes=None)[source]¶
Returns the set of VN roles that can be mapped to a FN role in a given context
Parameters: - fn_role (str.) – The FrameNet role.
- fn_frame (str.) – The FrameNet frame in which the roles have to be mapped.
- vn_classes (str List.) – A list of VerbNet classes for which the roles have to be mapped.
Parma vn_role: The VerbNet role.
Returns: str List – The list of VN roles