Nasty.Language.Spanish.SRLConfig (Nasty v0.3.0)

View Source

Configuration for Spanish Semantic Role Labeling (SRL).

Provides Spanish-specific verb frames, argument patterns, and role identification rules for the generic SRL labeler.

Spanish Verb Frames

Spanish verbs follow similar argument structures to English:

  • Agent (A0): quien realiza la acción (who performs action)
  • Patient (A1): quien recibe la acción (who receives action)
  • Instrument (A2): con qué se realiza (with what)
  • Beneficiary (A3): para quién (for whom)
  • Location: dónde (where)
  • Time: cuándo (when)

Spanish-Specific Features

  • Flexible word order (SVO, VSO, VOS)
  • Pro-drop subjects (null agent)
  • Reflexive constructions (se constructions)
  • Clitic pronouns encoding arguments

Example

iex> sentence = parse("María le dio un libro a Juan ayer")
iex> roles = SRLLabeler.label(sentence)
[
  %Role{type: :agent, span: "María"},
  %Role{type: :theme, span: "un libro"},
  %Role{type: :recipient, span: "a Juan"},
  %Role{type: :time, span: "ayer"}
]

Summary

Functions

Returns true if the clitic is a direct object (accusative).

Returns true if the clitic is an indirect object (dative).

Returns Spanish SRL configuration for use by the generic labeler.

Returns the semantic role typically associated with a Spanish preposition.

Returns the verb frame for a given Spanish verb (lemma).

Returns true if the clitic is reflexive.

Functions

accusative_clitic?(clitic)

@spec accusative_clitic?(String.t()) :: boolean()

Returns true if the clitic is a direct object (accusative).

dative_clitic?(clitic)

@spec dative_clitic?(String.t()) :: boolean()

Returns true if the clitic is an indirect object (dative).

get()

@spec get() :: map()

Returns Spanish SRL configuration for use by the generic labeler.

get_role_for_preposition(prep)

@spec get_role_for_preposition(String.t()) :: atom() | nil

Returns the semantic role typically associated with a Spanish preposition.

get_verb_frame(verb_lemma)

@spec get_verb_frame(String.t()) :: atom() | nil

Returns the verb frame for a given Spanish verb (lemma).

reflexive_clitic?(clitic)

@spec reflexive_clitic?(String.t()) :: boolean()

Returns true if the clitic is reflexive.