Moe Chizari

Projects

The write-up

Interactive demo, added

The AI Business chatbot project: try it.

Ask a question about a made-up shop: TF-IDF finds the closest known question, and the page shows the SQL, the result and a plain answer.

Try it

Move the controls; the chart and the sentence under it update.

Word weight in your question (TF-IDF)0.00.51.0needneed: weight 0.57, also in the matched question0.57moremore: weight 0.57, also in the matched question0.57buybuy: weight 0.50, also in the matched question0.50productproduct: weight 0.31, also in the matched question0.31

Closest known question: "What product do we need to buy more of?" (cosine similarity 1.00). Darker bars: words it shares with your question.

SELECT name, stock, reorder_at
FROM products
WHERE stock < reorder_at
ORDER BY stock - reorder_at;
namestockreorder_at
Wood screws (100)925
White paint 1L615
Screwdriver set48

Answer: 3 products are below their reorder level: Wood screws (100) (9 in stock, reorder at 25), White paint 1L (6 in stock, reorder at 15) and Screwdriver set (4 in stock, reorder at 8).

A made-up shop with eight products. Matching your question to eight known questions by word weights stands in for the language model the write-up describes; the SQL and the answer are computed in your browser. Not the original chatbot or its data.

The write-up this goes with: The AI Business chatbot project.

All demos