Training Your AI Using Triples

In this example we will walk you through how to train your AI. First create a file with facts formatted as Subject Verb Object.

Below is the contents of an example file,

s,v,o,Label
me,love,cat,Yes
me,love,dog,Yes

This file will contain core facts that define what your AI believes. You load the file into Triples=Lang using the records command.

records load facts.csv;

Now you can train a learner on the data, For simple response models based on facts, a tree works well. You train the AI using the learner command then specify the learner, the independent columns and the target column,

learner tree s|v|o->Label;


Once the model finishes you can save the model for later reuse.

learner save tree->fact.tree;

Loading a model is similar to saving.
learner load tree->fact.tree;

Now your AI is ready to respond to a question,

reason decide me|love|cat|;  

Your AI will repsond

True

Quick Start

Creating a variable

set myar 1

Getting a variable

echo myvar

Logic

set myvar2 3

more myvar1 myvar2

Math

add myvar1 myvar2

Flow Control

flow if start

less myvar1 myvar2

echo hello

flow if end

While Statement

set v1 0;
set v2 3;

flow while start;

increment v1;

flow if start;
more v1 v2;
flow break;
flow if end;

temporal pause one;

echo v1;

flow while end;

Reading a file

file read README.md
echo row;
file close;

Creating.a Function

function route_1;
echo "func 1";
end_function;