Algorithm for learning DFA from demonstrations, examples, and language.
Project description
L*LM
Implementation of L*LM algorithm algorithm. See project page for details.
Table of Contents
Installation
If you just need to use lstar_lm
, you can just run:
$ pip install lstar_lm
For developers, note that this project uses the poetry python package/dependency management tool. Please familarize yourself with it and then run:
$ poetry install
Usage
The main entry point for using this library is the guess_dfa
function.
from lstar_lm import guess_dfa
An invocation of guess_dfa
takes the form.
dfa = guess_dfa(
positive = ..., # List of positive examples. Each example is a list of tuples of tokens.
negative = ..., # List of negative examples. Each example is a list of tuples of tokens.
alphabet = ..., # List of (hashable) tokens.
task_description = ..., # String of task description.
allow_unsure = ..., # Whether to allow unsure responses (default True).
random_iters = ..., # Number of random queries to oracle.
active_queries = ..., # Number of active queries to oracle.
use_dfa_identify = ..., # True if use SAT based DFA identification. False uses L* + SAT hybrid.
llm_endpoint = ..., # http endpoint for llama.cpp server (default "http://localhost:8080/completion").
)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lstar_lm-0.1.0.tar.gz
(6.4 kB
view hashes)