Operationalizing a National Digital Library: The Case for a Norwegian Transformer Model
Paper • 2104.09617 • Published • 2
Run NbAiLab/nb-bert-base-pos on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/NbAiLab/nb-bert-base-pos. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/NbAiLab/nb-bert-base-pos on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use NbAiLab/nb-bert-base-pos with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("token-classification", model="NbAiLab/nb-bert-base-pos") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForTokenClassification
tokenizer = AutoTokenizer.from_pretrained("NbAiLab/nb-bert-base-pos")
model = AutoModelForTokenClassification.from_pretrained("NbAiLab/nb-bert-base-pos", device_map="auto")How to use NbAiLab/nb-bert-base-pos with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download NbAiLab/nb-bert-base-pos --local-dir nb-bert-base-pos
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForTokenClassification
tokenizer = AutoTokenizer.from_pretrained("NbAiLab/nb-bert-base-pos")
model = AutoModelForTokenClassification.from_pretrained("NbAiLab/nb-bert-base-pos", device_map="auto")Release 1.0 (November 6, 2024)
NB-Bert base model fine-tuned on the Part of Speech task using the NorNE dataset.
from transformers import pipeline
pos = pipeline("token-classification", "NbAiLab/nb-bert-base-pos")
example = "Jeg heter Kjell og bor i Oslo."
pos_results = pos(example)
print(ner_results)
More on https://arxiv.org/abs/2104.09617
Quantized
Base model
NbAiLab/nb-bert-base
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="NbAiLab/nb-bert-base-pos")