Downloads · 30 days
6
29% of all-time downloads
Biotz/ossamma-ner-onnx
ossamma-ner-onnx is a machine learning model from Biotz. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
OssammaNER is a 75M parameter NER model using the Ossamma architecture (Oscillatory State Space Attention Masked Mixer Architecture).
Downloads · 30 days
6
29% of all-time downloads
All-time downloads
21
Public
Repo size
237 MB
Likes
0
Public
Click a slice to open those files.
.data236 MB · 100%
From the Hugging Face model README
OssammaNER is a 75M parameter NER model using the Ossamma architecture (Oscillatory State Space Attention Masked Mixer Architecture).
| Label | Description |
|---|---|
| ART | Artworks, creative works |
| BUILDING | Buildings, structures |
| EVENT | Events, occurrences |
| LOCATION | Places, geographic entities |
| ORGANIZATION | Companies, institutions |
| OTHER | Miscellaneous entities |
| PERSON | People, characters |
| PRODUCT | Products, items |
import onnxruntime as ort
import numpy as np
# Load model
session = ort.InferenceSession("model.onnx")
# Tokenize input (requires compatible tokenizer)
token_ids = np.array([[101, 7592, 1010, 2088, 999, 102]]) # Example
# Run inference
emissions, boundary_logits = session.run(None, {"token_ids": token_ids})
# Get predictions
predictions = np.argmax(emissions, axis=-1)
For full model fidelity including CRF decoding, use the Julia implementation:
using Ossamma
using Ossamma.NER: OssammaNER, predict_labels, extract_entities
# Load model
model = OssammaNER("configs/ner_production_110m.toml")
checkpoint = load_checkpoint("checkpoint_best.jls")
ps, st = checkpoint.params, checkpoint.state
# Inference
tokens = [101, 7592, 1010, 2088, 999, 102]
labels = predict_labels(model, ps, st, tokens)
entities = extract_entities(tokens, labels)
OssammaNER(
TokenEmbedding: 32000 × 640
PositionEmbedding: 256 × 640
TimeEmbedding: Sinusoidal (192 dim)
Blocks × 10:
TimeConditionedLayerNorm
GLU Branch:
- Dense(640 → 1280)
- LinearAttention (10 heads)
- DLinOSS (oscillator SSM)
- Dense(640 → 640)
Local Branch:
- SWAttention (window=32)
- Input Gate
Adaptive Mixing (α-blending)
SwiGLU FFN (640 → 960 → 640)
OutputLayerNorm
ClassificationHead: LayerNorm → Dropout → Dense(640 → 17)
BoundaryHead: LayerNorm → Dense(640 → 2)
CRF: LinearChainCRF (17 labels)
)
.jls checkpoint@software{ossamma_ner,
title={OssammaNER: Oscillatory State Space Attention for Named Entity Recognition},
author={Biotz},
year={2024},
url={https://huggingface.co/Biotz/ossamma-ner}
}
MIT License