QSTN#
QSTN is a Python framework designed to facilitate the creation of robust inference experiments with Large Language Models based around questionnaires. It provides a full pipeline from perturbation of prompts, to choosing Response Generation Methods, inferencing and finally parsing of the output. QSTN supports both local inference with vllm and remote inference via the OpenAI API.
Tutorials#
We show a number of tutorials here, starting with an installation and a minimum usage example.
We also show how to use QSTN for real experiments, including how to use it to get answers from the German General Personas Dataset.
Getting Started
API Reference#
The full documentation can be found below.
API Reference
- Detailed Documentation
- QSTN
- Prompt Generation
LLMPromptLLMPrompt.DEFAULT_JSON_STRUCTURELLMPrompt.DEFAULT_PROMPT_STRUCTURELLMPrompt.DEFAULT_QUESTIONNAIRE_IDLLMPrompt.DEFAULT_SYSTEM_PROMPTLLMPrompt.DEFAULT_TASK_INSTRUCTIONLLMPrompt.duplicate()LLMPrompt.generate_question_prompt()LLMPrompt.get_prompt_for_questionnaire_type()LLMPrompt.get_question()LLMPrompt.get_question_item_id()LLMPrompt.get_questions()LLMPrompt.insert_questions()LLMPrompt.load_questionnaire_format()LLMPrompt.prepare_prompt()LLMPrompt.questionsLLMPrompt.remove_question()LLMPrompt.replace_question()
generate_likert_options()
- Survey Manager
- Subpackages
- Prompt Generation
- QSTN