File size: 1,135 Bytes
f2878d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//! TinyDecide: a small typed decision model. You give it one message (the *state*) and any number
//! of questions written in plain language; one encoder pass returns calibrated probabilities for
//! all of them, with no text generation.
//!
//! ```no_run
//! use tinydecide::{Question, TinyDecide};
//! let model = TinyDecide::load("path/to/TinyDecide")?;   // meta.json + model.bin
//! let r = model.answer(
//!     "Book a table for 4 at an Italian place near the station on Friday at 7:30",
//!     &[Question::choice("Which app should handle this?", &["reminders", "calendar", "restaurants"]),
//!       Question::span("Extract the time.")],
//! )?;
//! println!("{:?} {:?}", r.answers[0].pick, r.answers[1].text);
//! # Ok::<(), tinydecide::Error>(())
//! ```
//!
//! This crate is a port of the reference JavaScript engine (`tinydecide.js`) and is checked against
//! it by `tests/conformance.rs`.

pub mod corrections;
mod engine;
mod error;
pub mod tokenizer;
mod weights;

pub use engine::{Answer, Protos, QType, Question, Response, TinyDecide, Tokens};
pub use error::{Error, Result};
pub use weights::{Cfg, Format, Meta};