nlg_generative_lm ================= .. py:module:: nlg_generative_lm .. autoapi-nested-parse:: Generative natural language generation using a language model. Classes ------- .. autoapisummary:: nlg_generative_lm.LMGenerativeNLG Module Contents --------------- .. py:class:: LMGenerativeNLG(ollama_config_file: str, prompt_file: str, prompt_prefix: Optional[str] = None) Bases: :py:obj:`dialoguekit.nlg.nlg_abstract.AbstractNLG` Initializes the generative NLG. :param ollama_config_file: Path to the Ollama configuration file. :param prompt_file: Path to the prompt file. :param prompt_prefix: Prefix to be remove from generated utterances. Defaults to None. :raises FileNotFoundError: If the Ollama configuration file or the prompt file is not found. .. py:method:: generate_utterance_text(dialogue_acts: List[dialoguekit.core.dialogue_act.DialogueAct], annotations: Optional[Union[List[dialoguekit.core.annotation.Annotation], None]] = None, force_annotation: bool = False) -> Union[dialoguekit.core.annotated_utterance.AnnotatedUtterance, bool] Turns a structured utterance into a textual one. :param dialogue_acts: Dialogue acts of the utterance to be generated. :param annotations: If provided, these annotations should be considered during generation. :param force_annotation: A flag to indicate whether annotations should be forced or not. Not used in this NLG. :raises RuntimeError: If generation fails. :returns: Natural language utterance.