semvec/pypi-packages huggingface dataset:
grekt-keywords 0.1.0
Keyword extraction for grekt artifacts using KeyBERT
Requires Python: >=3.9
Keywords: artifact, grekt, keybert, keywords, nlp

# grekt-keywords

Keyword extraction for [grekt](https://grekt.com) artifacts using KeyBERT.

## Installation

```bash
# Recommended: CPU-only (~300MB)
pip install grekt-keywords --index-url https://download.pytorch.org/whl/cpu

# With GPU support (~4GB)
pip install grekt-keywords
```

## Usage

### CLI

```bash
# From argument
grekt-keywords "An agent that helps with Kubernetes deployments and Helm charts"

# From stdin
echo "An agent that helps with Kubernetes deployments" | grekt-keywords

# JSON output (for programmatic use)
grekt-keywords --json "Your artifact description here"
```

### Python API

```python
from grekt_keywords import extract_keywords

keywords = extract_keywords("An agent that helps with Kubernetes deployments")
# ['kubernetes', 'deployments', 'agent', 'helps']
```

## Options

| Option | Default | Description |
|--------|---------|-------------|
| `--min` | 3 | Minimum number of keywords |
| `--max` | 5 | Maximum number of keywords |
| `--json` | false | Output as JSON array |

## Why?

grekt artifacts require keywords for discoverability in the lazy-loading index. This tool extracts meaningful keywords from your artifact description using KeyBERT + MiniLM.

## Model

Uses `all-MiniLM-L6-v2` (~80MB) for keyword extraction.

**First run:** Downloads the model from [Hugging Face Hub](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) and caches it in `~/.cache/huggingface/`.

**Subsequent runs:** Uses the cached model (works offline).

For CI/CD environments, the model will be downloaded on first execution. You can pre-cache it by running `grekt-keywords "test"` once.

## License

MIT