Spaces:
Sleeping
Sleeping
metadata
title: Bayesian Token Co-occurrence Simulator
emoji: 🧮
colorFrom: blue
colorTo: indigo
sdk: docker
sdk_version: 3.0.0
app_file: app.py
pinned: false
Bayesian Token Co-occurrence Simulator
A Streamlit application that simulates and visualizes token co-occurrence patterns using Bayesian methods.
Local Development Setup
- Create and activate a virtual environment:
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On macOS/Linux:
source venv/bin/activate
# On Windows:
.\venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Run the application:
streamlit run app.py
The application will be available at http://localhost:8501
Docker Setup
- Build the Docker image:
docker build -t bayesian-token-simulator .
- Run the Docker container:
docker run -p 8501:8501 bayesian-token-simulator
The application will be available at http://localhost:8501
Hugging Face Spaces Deployment
- Clone your Hugging Face Space repository:
git clone https://huggingface.co/spaces/afscomercial/stf_model
- Copy your project files to the cloned repository:
cp -r app.py requirements.txt Dockerfile .huggingfaceignore stf_model/
- Push the changes to Hugging Face:
cd stf_model
git add .
git commit -m "Add Bayesian Token Co-occurrence Simulator"
git push
Your application will be automatically deployed to https://huggingface.co/spaces/afscomercial/stf_model
Project Structure
app.py: Main Streamlit applicationrequirements.txt: Python dependenciesDockerfile: Docker configuration.gitignore: Git ignore rules.huggingfaceignore: Hugging Face ignore rules
Features
- Interactive text input for training sentences
- Bayesian smoothing parameter adjustment
- Co-occurrence matrix visualization
- Next token prediction
- Real-time updates
Requirements
- Python 3.8+
- Streamlit
- NumPy
- Pandas
- Matplotlib
- Seaborn
- NLTK