Getting Started with LangCalc¶
Welcome to LangCalc! This guide will help you get up and running with the algebraic framework for compositional language modeling.
What You'll Learn¶
This section covers everything you need to start using LangCalc:
- Installation - How to install LangCalc and its dependencies
- Quick Start - A 5-minute tutorial to create your first model
- Core Concepts - Understanding projections, augmentations, and algebraic operations
Prerequisites¶
Before starting, you should have:
- Python 3.8 or higher installed
- Basic understanding of language models and probability distributions
- Familiarity with NumPy (helpful but not required)
Learning Path¶
For Beginners¶
If you're new to LangCalc:
- Start with Installation to set up your environment
- Follow the Quick Start for hands-on examples
- Read Core Concepts to understand the fundamentals
- Explore the User Guide for practical applications
For Researchers¶
If you're interested in the mathematical foundations:
- Install LangCalc following the Installation guide
- Read the Mathematical Formalism
- Study the Projection-Augmentation Duality
- Review the Academic Paper
For Developers¶
If you want to extend or contribute to LangCalc:
- Install with dev dependencies:
pip install -e .[dev] - Review the Reference Implementation
- Check the Contributing Guide
- Explore the Testing Documentation
Quick Example¶
Here's a taste of what you can do with LangCalc:
from langcalc import Infinigram, NGramModel
# Create models
corpus = [1, 2, 3, 4, 2, 3, 5, 6, 2, 3, 4]
infini = Infinigram(corpus, max_length=10)
ngram = NGramModel(corpus, n=3)
# Compose using algebra
model = 0.7 * infini + 0.3 * ngram
# Make predictions
context = [2, 3]
probs = model.predict(context)
Next Steps¶
Ready to dive in? Start with Installation!
Getting Help¶
If you get stuck:
- Check the User Guide for detailed examples
- Browse the API Reference for technical details
- Ask questions in GitHub Discussions
- Report bugs in GitHub Issues
Related Resources¶
- Examples Directory - Complete working examples
- Jupyter Notebooks - Interactive tutorials
- Test Suite - Reference implementations