Instructions to use tiagozip/undyne with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tiagozip/undyne with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="tiagozip/undyne")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("tiagozip/undyne") model = AutoModelForTokenClassification.from_pretrained("tiagozip/undyne", device_map="auto") - Notebooks
- Google Colab
- Kaggle
undyne
undyne is a 33m parameter model that highlights the answer to a question in a paragraph. if a question isn't present, it can also highlight the central claims.
examples
Why is the sky blue?
The sky is blue because of a phenomenon called Rayleigh scattering, named after the 19th-century British physicist Lord Rayleigh, who also discovered argon. Sunlight contains all colors of the visible spectrum, and when it hits molecules in Earth's atmosphere, shorter wavelengths like blue and violet scatter far more than longer wavelengths like red and orange.
Who is Rayleigh scattering named after?
The sky is blue because of a phenomenon called Rayleigh scattering, named after the 19th-century British physicist Lord Rayleigh, who also discovered argon. Sunlight contains all colors of the visible spectrum, and when it hits molecules in Earth's atmosphere, shorter wavelengths like blue and violet scatter far more than longer wavelengths like red and orange.
usage
you can find an example for usage in example.py.
from example import Undyne
m = Undyne("tiagozip/undyne")
m.spans(paragraph, "Why is the sky blue?") # [(47, 66), (261, 362)] char offsets
m.highlight(paragraph, "Why is the sky blue?") # markdown with ** ** around spans
m.highlight(paragraph) # no question, finds the central claim
onnx
| file | size | with question | without question |
|---|---|---|---|
onnx/model.onnx |
133 MB | fp32 | fp32 |
onnx/model_int8.onnx |
34 MB | 0.716 | 0.497 |
onnx/model_light.onnx |
21 MB | 0.709 | 0.505 |
limitations
english only. undyne sometimes works okay-ish on other languages, such as French and Spanish, but it was never trained on them.
trained on search-style text, such as search snippets, encyclopedia entries, assistant-style answers, and Wikipedia paragraphs. undyne degrades on text far from that, such as source code, dense tables, and poetry.
data provenance
paragraphs come from GooAQ, MS MARCO, Natural Questions, ELI5, Encyclopaedia Britannica article text, and SQuAD v1.1 (CC BY-SA 4.0, Rajpurkar et al., 2016). Base model: microsoft/MiniLM-L12-H384-uncased (MIT)
- Downloads last month
- 43
Model tree for tiagozip/undyne
Base model
microsoft/MiniLM-L12-H384-uncased