Skip to content

Getting Started

This repository contains a collection of Rust AI examples demonstrating various machine learning, deep learning, and natural language processing techniques.

  • Rust (latest stable version)
  • Cargo (comes with Rust)

Each example is a standalone Cargo project located in the examples/ directory.

Terminal window
# Navigate to an example directory
cd examples/<example-name>
# Run the example
cargo run
Example Category Status Requires
Text Classification NLP ✅ Runnable Local models/ BERT checkpoint
Sentiment Analysis NLP ✅ Runnable Internet (first run downloads model)
Language Detection NLP ✅ Runnable data/languages.json
Keyword Extraction NLP ✅ Runnable .txt files in documents/
Email Spam Classification NLP ⚠️ Incomplete Assets only; no source code yet
KNN Classifier ML ✅ Runnable data/iris.csv
Decision Tree Classifier ML ✅ Runnable data/loans.csv
House Price Prediction ML ✅ Runnable data/house.csv
Image Classification DL ✅ Runnable Internet (first run downloads model) + an image
OCR DL ⚠️ Incomplete No fn main; inference not implemented

Most examples read a fixed path relative to their own directory, so the simplest way to try your own data is to replace the committed file (keeping the same columns). Model-based examples either use a committed models/ directory or download it on first run.

This documentation site is built with Astro Starlight. To run it locally:

Terminal window
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview