Untuk mengatur environment development di localhost, jalankan:
# Install semua dependencies
pip install -r requirements.txt
# Jalankan setup script (opsional, untuk download model spaCy)
python setup_env.pyAtau gunakan setup script otomatis:
python setup_env.pySemua dependensi sudah terdaftar di requirements.txt:
- spacy (>=3.0,<4.0) - NLP processing
- scispacy (>=0.4.0,<0.5.0) - Biomedical NLP
- sentence-transformers (>=2.0.0,<3.0.0) - Semantic embeddings
- numpy (>=1.20.0,<2.0.0) - Numerical computing
- pandas (>=1.3.0,<3.0.0) - Data manipulation
- scikit-learn (>=0.24.0,<2.0.0) - Machine learning utilities
- jsonlines - JSON Lines format support
- requests - HTTP library
- matplotlib - Plotting library
- seaborn - Statistical visualization
- pytest - Testing framework
- pytest-cov - Coverage reporting
- black - Code formatter
- flake8 - Linting
- mypy - Type checking
# Create virtual environment
python -m venv venv
# Activate on Linux/Mac
source venv/bin/activate
# Activate on Windows
venv\Scripts\activate
# Install all dependencies
pip install -r requirements.txt
# Optional: Download spaCy models
python -m spacy download en_core_web_sm
python -m spacy download en_core_web_md# Create conda environment
conda create -n stip python=3.9
# Activate environment
conda activate stip
# Install dependencies
pip install -r requirements.txt
# Download spaCy models
python -m spacy download en_core_web_smJalankan script setup otomatis:
# Full setup (includes spaCy models)
python setup_env.py
# Skip model downloads (faster)
python setup_env.py --skip-modelsSetelah instalasi, verifikasi dengan:
# Run tests
pytest tests/ -v
# Run example
python examples/analyze_attention.py
# Check package versions
python -c "import spacy; print(spacy.__version__)"black stip/ tests/ examples/flake8 stip/ tests/mypy stip/pytest tests/ --cov=stip --cov-report=htmlUntuk setup pre-commit hooks:
# Install pre-commit
pip install pre-commit
# Install hooks
pre-commit install
# Run hooks manually
pre-commit run --all-filespython -m spacy download en_core_web_sm# Use user installation
pip install --user -r requirements.txt# Create fresh virtual environment
rm -rf venv
python -m venv venv
source venv/bin/activate
pip install -r requirements.txtSetelah setup selesai:
- Run tests:
pytest tests/ -v - Try example:
python examples/analyze_attention.py - Start developing: Edit files in
stip/directory - Generate sample data:
python data/generate_sample.py
Happy Coding! 🚀